Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
daez
Creator
Creator

Merge two column from two differents files into one

Hello everyone,

 

I have been struggling to solve my problem and didnt find a way on the forum. I have 2 files(maybe more after but I guess it will be done the same way), which have several columns. Here is what i would like to achieve : 

 

File A : 

Customer       Random_Info      Money

A                          xxxxxx             250

B                          xxxxxx             360

C                          xxxxxx             500

 

File B : 

Customer       Random_Info      Money

J                         xxxxxx             150

F                         xxxxxx             400

S                         xxxxxx             600

 

 

File required : 

 

Customer             Money

A                              250

B                              360

C                              500

J                               150

F                               400

S                              600

 

 

The column name might be different in the files tho( like one with "Customer "& the other one "Customer_name") , and there is no ID. All my Tmap & XMLmap jobs failed ... 

 

Thanks a lot for your help,

 

 

 

Labels (3)
1 Solution

Accepted Solutions
manodwhb
Creator III
Creator III

@daez,sorry my mistake ,you take two file inputs and read those and then use tUnit to do union and the in tFilterCoulmns populate   Customer and Money,populate to target.

View solution in original post

12 Replies
manodwhb
Creator III
Creator III

@daez,you should do fullouter join,please check the below link to implement your case.

https://community.talend.com/t5/Architecture-Best-Practices-and/How-to-do-a-full-outer-join-in-a-Tal...

daez
Creator
Creator
Author

Hello @manodwhb, thanks for your time. 

 

I already tried this link, yet I dont have any ID on my files. I tried to create one but I think I'm missing something ... 0683p000009M0d7.png

 

I tried to do 2 files with 2 rows each, CustR & CustF are from my second files (the Lookup one). I dont manage to have my 4 rows ... Here is a screenshot of my tmap too ... Thanks for you help

 

0683p000009M19C.png

manodwhb
Creator III
Creator III

@daez,your design is wrong,please check Example 1—Performing Two Left Outer Joins with Files  in below link.

https://community.talend.com/t5/Architecture-Best-Practices-and/How-to-do-a-full-outer-join-in-a-Tal...

daez
Creator
Creator
Author

@manodwhb,

 

Yes, i tried severals possibilities but only screenshoted my latest attempt.

Still, I cant configure the Tmap as the example since i have no ID to match on. So I cant put my Match Model on " Unique match " and when I run my job its not working ... Here is a screenshot, please if you have a hint.

 

0683p000009M0un.png

 

 

 

manodwhb
Creator III
Creator III

@daez,then i am pretty sure you were missing a primary and lookup selection?  for example tMap1 if you use soruce 1 as a primary and source 2 as lookup,for tMap2 you have reverse like source 2 as primary and source 1 a lookup. 

daez
Creator
Creator
Author

Yes this is what I understood and did (I think).

 

tFileInput 1 : Source 1 (main)

tFileInput 2 : Source 2 (look up)

 

tFileInput 3 : Source 2 ( main)

tFileInput 4 : Source 1(look up)

 

Please, let me know if I am correct. (Match Model is on "All rows" because I cant save on " Unique Match")

 

tMap 1 :

0683p000009M0qg.png0683p000009M19R.png

 

 

tMap 2 :

manodwhb
Creator III
Creator III

@daez,you have not joined anything in your tMaps,check that?

daez
Creator
Creator
Author

@manodwhb, Sorry but i feel rusty. Do you mean a expr key ? What can i join if there is no ID ? 

manodwhb
Creator III
Creator III

@daez,sorry my mistake ,you take two file inputs and read those and then use tUnit to do union and the in tFilterCoulmns populate   Customer and Money,populate to target.