Four Stars

Denormalize data

I have read some articles on the tdenormalize component, but I don't think it does what I want.

 

Example input file:

 

ID Name Address     Email

1  Tony 49 Hill Rd  Tony@somewhere.com

1  Tony 49 Hill Rd  Tony@elsewhere.com

1  Tony 49 Hill Rd  Tony@nowhere.com

 

I want to convert this to:

 

ID Name Address     Email1             Email2              Email3

1  Tony 49 Hill Rd  Tony@somewhere.com Tony@elsewhere.com  Tony@nowhere.com

 

There will be a max of three emails, but not all may be present so I need blanks in subsequent fields.

 

I can see that tdenormalize can put all three emails into a SINGLE column.  I don't want this.

 

Any ideas?

 

Thanks,

 

Tony

 

 

 

2 REPLIES
Seven Stars sgv
Seven Stars

Re: Denormalize data

Hi !

You can do it like this ! You must aggregate with group by on id/name/adress.
And use a list object for mail.
Then in your tMap you just get the element of your list.

 

Good luck,

SGV

 

solution.png

Twelve Stars TRF
Twelve Stars

Re: Denormalize data

You may also have a look at tPivotToColumnsDelimited. Check this link for an explaination with an example very close to yours:
http://www.helicaltech.com/transpose-rows-to-columns-using-talend-open-studio/
Hope this helps.

TRF