Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Dynamic Join in tMap

Dear Talend Community,
I am new to Talend and using TOS for Data Integration. I have a scenario in which I have to join to tables in tMap based on a user input parameter while the field in the lookup table always remains the same lets say matching_field. For example if the user input param is "A" then I have to take Field Y in the primary table and join it with matching_field in the second table. If the user input param is "B" then I have to take Field Z in the primary table and join it with the same matching_field in the second table. I just want to make this join in the tMap dynamic and not manually by hand (by dragging and dropping and having 22 tmaps for 22 different user inputs). Could you please guide me how can I achieve this? I am really stuck in middle of my project and cannot proceed without this. Your help will be appreciated. Thanks!
Best Regards,
John

Labels (2)
6 Replies
Anonymous
Not applicable
Author

Hi John,
I'm waiting for the response of others but I personally see only one solution.
One tmap with 22 lookups and one output
you'll need to filter the output link with the lookup you want.
So, if someone has better....
Anonymous
Not applicable
Author

Hello Carlos,
I think you slightly misunderstood my problem. I want to pick one column from my primary table (x,y,z) and join it with matching_field in lookup table. So on run time i have to decide which column from x y and z to pick and join. This decision will be done based on user input. 
Regrds,
John
Anonymous
Not applicable
Author

Hi John,
I think i have understood your request.
On the tMap, make three lookups with your primary link where you have the x, y, z columns. One lookup by columns so one with the x column, one with the y and the last one with the z coumn.
Then, in the tMap, you can choose, filtering the data, the lookup you want to use.
I know it's not the better solution because you have to make 3 accesses to the db but it can be the only solution.
By the way, if your queries are retrieving a huge number of rows, forget my solution.
If someone have better....
Anonymous
Not applicable
Author

Hi,

I was just wondering if I could use if/else conditional statements inside the mapping field by using Expression. Seems like there is a way to do that. Could anyone tell me if that is possible. If it is then please guide me how? Your help will be appreciated.

Thanks!

BR,
John
Anonymous
Not applicable
Author

Do you guys have any idea about this?
Anonymous
Not applicable
Author

Hi John,

You can use "if/else" statement inside tmap.

Try to add a variable inside the tmap and then add your logic expression. Ex : row2.PRICE < 5 ? "Yes, price is <5" : "No, price is > 5"