Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

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

2 Replies
Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

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. 0683p000009MACn.png