Merge rows on basis of id

Highlighted
Four Stars neo
Four Stars

Merge rows on basis of id

Hi

I need to convert the following input to the output below:

 

id | store | city | state
-------------------------
1  |   tgt   | ojx  | ohio
1  |   hps | rnh | texas
1  |   mto | erd | NJ
2  |   msi | dmi | CA
2  |   gto  | edx | NY

 

The input table contains 4 columns and 5 rows.

 

The output should be as 

id  |     data
-------------------------
1   |  tgt , ojx , ohio
     |  hps , rnh , texas
     |  mto , erd , NJ

-------------------------
2   |  mso , dms , CA
     |  gto , edx , NY

 

The output table consists of 2 columns and 2 rows. 

I was able to merge columns by concatenating them using tmap but need help next. 

 

Thanks


Accepted Solutions
Employee

Re: Merge rows on basis of id

Hi,

 

     Please use tDenormalize component for your use case. There are multiple sample scenarios in the help document and some of them are very similar to your scenario.

 

https://help.talend.com/reader/wDRBNUuxk629sNcI0dNYaA/K4daeny9X_pgAhOiBR~Kug

 

Warm Regards,

 

Nikhil Thampi

View solution in original post


All Replies
Employee

Re: Merge rows on basis of id

Hi,

 

     Please use tDenormalize component for your use case. There are multiple sample scenarios in the help document and some of them are very similar to your scenario.

 

https://help.talend.com/reader/wDRBNUuxk629sNcI0dNYaA/K4daeny9X_pgAhOiBR~Kug

 

Warm Regards,

 

Nikhil Thampi

View solution in original post

Four Stars neo
Four Stars

Re: Merge rows on basis of id

Thanks for the help. I did explore the tDenormalize component earlier but was confused how id wont be repeated. I do get it now. Thanks for your help. Much appreciated. Smiley Happy

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog