Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Left Join with Where clause on the Join

I have not found an answer to how to write a Left Join where I only want the rows in the Left table that DON'T have a value in the right table.  Maybe this is a 2 step process of creating the joined table and then reloading with the Where clause?  Thanks for your help.

3 Replies
felipedl
Partner - Specialist III
Partner - Specialist III

Just write of the regular left join and on a second resident load, do a check to which values don't exist.

Something like this:

data:

Load * inline

[

     Id,Value

     1,A

     2,B

     3,C

];

NoConcatenate

joinData:

Load * inline

[

     Id,Value

     1,A

     2,B    

];

left join (data)

Load *,

          1 as [Flag Exists]

Resident joinData;

NoConcatenate

finalData:

Load *

Resident data

where isNull([Flag Exists]);

drop tables data,joinData;

QlikNoviceNo1
Contributor III
Contributor III

Thanks Felip for the solution.

I tried the below and it worked. I renamed the common field in table2 to make this happen.

data:

Load * inline

[

   Id,Value

     1,A

     2,B

    3,C

];

left join (data)

Load * inline

[

     Id,ValueB

     1,A

     2,B   

] ;

NoConcatenate

Final:

Load *

Resident data

where IsNull(ValueB);

drop Table data;

felipedl
Partner - Specialist III
Partner - Specialist III

Awsome,

Can you mark the correct anwser as correct so others can see it?

Thanks.