Home > Back-end >  How use vlookup (equivalent) like excel in Talend
How use vlookup (equivalent) like excel in Talend

Time:08-14

I have an input excel file structured as follows:

id name Parentid ParentName
1 Name1
2 Name2 Name1
2 Name3 Name2

I want to retrieve the id of the parent name id in a new dedicated column ParentID. The result I'm looking for:

id name Parentid ParentName
1 Name1
2 Name2 1 Name1
3 Name3 2 Name2

In excel I would simply use in the Parentid cells : =IFERROR(VLOOKUP(C2;A$2:D$5;4;FALSE);"")
But I don't find how to achieve it in Talend, how should i do this ?

CodePudding user response:

  1. Read the source as main input and connect it with tMap component
  2. Read the same source as lookup and connect it with tMap component
  3. Apply the join condition on ParentName = Name in tMap
  4. Connect the output from tMap to any output component to view results

For an example I have used tFixedFlowInput component instead of excel input.

enter image description here enter image description here enter image description here enter image description here

  • Related