Saturday 10 December 2011

talend - etl - one way to split single row to multiple row and give output in same output group in tmap

Problem - you have following data as given below in a single row and you want to generate two rows out of this..
CountryName1 CountryCode1 CountryName2 CountryCode2
INDIA                    IND                  EGYPT             EG


Solution - though there are many solutions, one quick solution incase you have requirement like above, where you know number of rows you want to split -
Take this row as input to tmap component and in tmap create one output group say out_1.
Now in this out_1 drag and link countryName1 and countryCode1 columns from input.
Now create another output group out_02 in this tmap and when "add a output" dialog comes
select "create join table from" and in the dropdown select out_1 group, so that our output rows from this out_02 group will also go to out_01 group. So our tmap will have only one output group out_01 containing rows from both out_01 and out_02. now in out_02 drag and link countryName2 and CountryCode2 columns.





3 comments:

  1. Really helpful, why didn't i read it this morning ! lol, thank you !

    ReplyDelete
  2. Thanks, that's the easiest way I found and it's working perfectly.

    ReplyDelete
  3. hi, thanks for sharing...keep it up

    ReplyDelete