Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator III
Creator III

Compare fields from multiple tables

I have tables as shown (First row is table name)

Limited
ID

 

Full Table
ID

 

Alternate Table
ID2

 

I need to check if ID2 has any matching values in Full Table 'ID' and if it does, then check if ID2 matches with any Limited table 'ID'

In simple case, 

if(Alternate Table ID2 = Full Table ID, then check

if(Alternate Table ID2= Limited 'ID', then 'Yes','No') in the script. 

How do I achieve this in the script?

Labels (1)
1 Solution

Accepted Solutions
jwjackso
Specialist III
Specialist III

If you are adding this Yes/No flag to the [Alternate Table].

mapLimitedID:

mapping

load ID,

          '1' as IDFlag

Resident [Limited];

 

mapFullTableID:

mapping

load ID,

         '1' as IDFlag

Resident [Full Table];

 

[Alternate Table]:

load ID2

         If(ApplyMap('mapFullTableID',ID2,'0') = '1',

         If(ApplyMap('mapLimitedID',ID2,'0') - '1','YES','No'),'No')

From AlternateTableSource;

 

View solution in original post

2 Replies
jwjackso
Specialist III
Specialist III

If you are adding this Yes/No flag to the [Alternate Table].

mapLimitedID:

mapping

load ID,

          '1' as IDFlag

Resident [Limited];

 

mapFullTableID:

mapping

load ID,

         '1' as IDFlag

Resident [Full Table];

 

[Alternate Table]:

load ID2

         If(ApplyMap('mapFullTableID',ID2,'0') = '1',

         If(ApplyMap('mapLimitedID',ID2,'0') - '1','YES','No'),'No')

From AlternateTableSource;

 

qlikwiz123
Creator III
Creator III
Author

Thank You