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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Do an if comparison with fields from two tables in script

Hi Community,

How would I go about using two tables in the script to compare 2 different fields?  Something like the following:

if(match(Table1Field1,Table2Field1),Table2Field2) as Field

i.e. how would I code the loading of the resident tables and such to get this to be able to work?

Regards,

Brandon

1 Solution

Accepted Solutions
jagannalla
Partner - Specialist III
Partner - Specialist III

Hello,

You can do this using mapping concept. For example

Table1:
LOAD CustomerID,
     CustomerName
     Address,
     CustomerCode,
     ZipCode,
     City,
     Country,
FROM Customers.qvd (qvd);

Map1:
MAPPING LOAD CustomerID,
     
CustomerID as CID
RESIDENT Table1;


Table2:
LOAD InvoiceID,
     Date,
     CID,
     ApplyMap('Map1', CID, Null()) AS CID1
FROM Invoices.qvd (qvd);


Hope it helps you

View solution in original post

2 Replies
jagannalla
Partner - Specialist III
Partner - Specialist III

Hello,

You can do this using mapping concept. For example

Table1:
LOAD CustomerID,
     CustomerName
     Address,
     CustomerCode,
     ZipCode,
     City,
     Country,
FROM Customers.qvd (qvd);

Map1:
MAPPING LOAD CustomerID,
     
CustomerID as CID
RESIDENT Table1;


Table2:
LOAD InvoiceID,
     Date,
     CID,
     ApplyMap('Map1', CID, Null()) AS CID1
FROM Invoices.qvd (qvd);


Hope it helps you

Not applicable
Author

Wonderful!  Thank you, thats very helpful!