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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] 2 tables to 1 by tMap

Hi All, I have 3 tables: transaction, details, backup.
I would like to check:
IF (ID in transaction is equal to the ID in details)
the address in details table will be imported to the backup
ELSE
null;
How do I do that ?
My table is currently join together by transaction --> tMap --> Backup
Labels (2)
17 Replies
Anonymous
Not applicable
Author

Hi,
You can use  ternary operator for if-else scenario in tMap or join your two tables.
The expression looks  like: Condition?value if true:value if false
Best regards
Sabrina
TRF
Champion II
Champion II

Hi,
Use Transaction as the main flow for the tMap and Details as the lookup.
Join both tables in the tMap using the ID column and a Left Outer Join.
On Backup flow, populate all columns from Transaction but address from Details.
0683p000009MDmx.png
Regards,
TRF
Anonymous
Not applicable
Author

Hello TRF, how do I do a left outer join?
Anonymous
Not applicable
Author

Hello xdshi, I tried this method also but it didn't work.
I have 40 rows in transaction and 5998 rows in details. After I connect the transaction as main and details as lookup to the tmap, the output becomes 239920 rows. I wanted only 40 rows of data for the output. Please help.
TRF
Champion II
Champion II

This is the default. See the line "Join Model" on the capture.
Anonymous
Not applicable
Author

@TRF, I have 40 rows in transaction and 5998 rows in details. After I connect the transaction as main and details as lookup to the tMap, the output becomes 239920 rows. I wanted only 40 rows of data for the output. Please help.
TRF
Champion II
Champion II

Drap and drop ID from Transaction to Details to establish the join or you'll get a cartesian product
Anonymous
Not applicable
Author

@TRF, oh! However, I have ID1 and ID2 in Transaction and only ID in Details. How do I establish the join?
The backup table also have ID1 and ID2.
Details of ID1 and ID2 can be extracted from ID in details.
I tried adding row1.ID1 + row4.ID2 into the expression for ID.
However I receive this error message:
Exception in component tMap_1
java.lang.NullPointerException
TRF
Champion II
Champion II

Give an example (with sample data) to your data in and expected result