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


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

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

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch

Downloads and Trials

Test drive Talend's enterprise products.

Downloads