Search code examples
csvtalend

adding multiple entries side by side in talend


I have customer_data.csv as follows:

first_name,last_name,cust_no
Test,User1,12345
Test,User2,99999

My address_Details.csv is as follows:

addr_type,line1,line2,line3,cust_no
work,x,y,z,12345
school,a,b,c,12345
Homehome, ,m, ,n, ,o, ,12345
work,1,2,3,99999

My final output should be as follows:

first_name,last_name,cust_no,no_of_addrs,add_type,line1,line2,line3
test,User1,12345,3,work,x,y,y,school,a,b,c,home,m,n,o
test,User2,99999,1,work,1,2,3,,,,,,,,

Where each id has the number of entries joined together?

I used map Talend job Mapping I have gotten the following result:

Test|User1|12345|work|x|y|z
Test|User1|12345|school|a|b|c
Test|User1|12345|home|m|n|o
Test|User2|99999|work|1|2|3

What component must I use instead?


Solution

  • 1st: the main must be customer_data.csv and the lookup must be address_Details.csv.
    2nd: if you want to reject customer without any address, in the tMap, click on the wrench in the lookup table then select "inner join" and on the outpu table, click the wrench and select "catch lookup inner join reject" to True (False is the default).

    Regards,
    TRF