Saturday, 10 December 2011

Talend ETL how to concatenate strings during group by / aggregate operations taggreraterow

Problem - you have multiple rows for same group key but these rows has some string column which you want to get into your processing but want to concatenate this column values for same group key rows into one. example you have data in your table that tells a product is shippable at what locations
ProductName ShipLocation
Prod_01       IND
Prod_01       US
Prod_01      CA
Prod_02    UK
.....

You need a result like
Prod_01 IND;US;CA
Prod_02 UK

Solution - input the rows into tAggregateRow and group by ProductName. In the output Column select shipLocation and in function use LIST and input column position again select shiplocation.
(make sure you increase size of your output shiplocation column in schema)
in the advance settings for tAggregateRow you can use delimeter as ;.
when you take output from this tAggregateRow it returns the output as desired (semicolon separated and concatenated for each group key)

7 comments:

  1. thanks really useful thanks again

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Talend Online Training
    Introduction
    Introduction to Talend
    Why Talend?
    Talend Editions and Features
    Talend Data Integration Overview
    Talend Environment
    Talend Environment - Overview
    Repository and Pallate
    Talend Design and Views
    http://www.21cssindia.com/courses/talend-online-training-160.html
    IT SUPPORT ONLINE TRAINING, SEO SERVICES, Call Us +917386622889
    Employees to learn at their own pace and maintain control of learning “where, when and how” with boundless access 24/7by 21st Century Software Solutions. contact@21cssindia.com

    ReplyDelete
  4. Talend Context Variables - http://www.21cssindia.com/courses/talend-online-training-160.html
    Context Variables - Overview - Creation and Usage of Context Variables - Context Groups - Dynamic Job designs using Context variables - Talend Metadata Connections - Built-in Connections - Shared Connections - Source and Destination Connections - Database Connections - Usage of connections in Job - Talend Server Server Architecture - Job execution on Server - Project Settings - Stats & Logs - Logs & Error Handling - Logs in Talend - Error Handling in Talend - Logs & Error Handling Components - Java Error Codes - Practices & Sample Jobs - Sample Jobs - Component work outs - Job Deployment on TAC - Employees to learn at their own pace and maintain control of learning “where, when and how” with boundless access 24/7by 21st Century Software Solutions. contact@21cssindia.com
    http://www.21cssindia.com

    ReplyDelete