Joining 3 input in a TMap

One Star

Joining 3 input in a TMap

Hello,
i'm new to Talend, and i have a problem.
I have 3 input in my Tmap, A,b and C.
input A contain: Id
input B:
         -Id
         -Operator
          -Code_Alpha
input C contains:
          -ID
           -infoA
            -infoB
            -Country
            -Support
The problem is:
Now, the country and support of the input C are empty, the goal is to have the table C as an output, with Country and Support filled in with the right informations.
My probleme is, there is a condition to fill these field, and i don't know how to apply it.
The condition is:
We should keep in mind that InfoA and Info B are different, and B.Id stocks infoA and InfoB
if infoA == A.ID  we take operator and code_alpha from table B where b.Id = infoB and  we assign operator to support and code_alpha to country
if infoB == A.ID  we take operator and code_alpha from table B where b.Id = infoA and  we assign operator to support and code_alpha to country
i hope i was clear in my explanation,
And Thank you for your help in advance,
One Star

Re: Joining 3 input in a TMap

you can split it into two flows.
1st flow , inner join the 3 tables ( infoA == A.ID  we take operator and code_alpha from table B where b.Id = infoB and  we assign operator to support and code_alpha to country )
2nd flow inner join the 3 tables again, (infoB == A.ID  we take operator and code_alpha from table B where b.Id = infoA and  we assign operator to support and code_alpha to country) and you update insert the same table.
or you store both outputs in a file ou hashoutput and you do union.
Good luck
One Star

Re: Joining 3 input in a TMap

Actually what i forgot to mention is, that infoA should'nt be equal to A.id, the condition  is:
 
if infoA is in the tfileInputDelimited then we take operator and code_alpha from table B where b.Id = infoB and  we assign operator to support and code_alpha to country
so for each line in input c i should verify if infoA is in input A  then we take operator and code_alpha from table B where b.Id = infoB and  we assign operator to support and code_alpha to country