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:
- Read the source as main input and connect it with tMap component
- Read the same source as lookup and connect it with tMap component
- Apply the join condition on ParentName = Name in tMap
- Connect the output from tMap to any output component to view results
For an example I have used tFixedFlowInput component instead of excel input.