Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Kelly_Anne001
Contributor
Contributor

Adding a where clause in a data load on a left join

I am very new to Qlik sense and data load scripting and have come across a challenge that is giving me some trouble in the way my data is presenting.

The Left Join works, however, I only need to join where there "-" does not exist in the field I am using to link the two data sets, and I need to prevent duplicating the line items after joining.

 

 

 

Labels (2)
4 Replies
Aditya_Chitale
Specialist
Specialist

you can use where not wildmatch (yourfield , '-') in your second table.

eg:

test:

load

.

.

.

from [xyz.qvd](qvd)  where not wildmatch (yourfield,  '-') ;

 

Regards,

Aditya

Kelly_Anne001
Contributor
Contributor
Author

Thank you so much.
It still does not seem to work so I do not think that is where the problem is. 

Let me do some more playing around. 

Thank you so much!

Chanty4u
MVP
MVP

Try this example

Table1:

LOAD Field1, Field2

FROM DataFile1.csv

(txt, codepage is 1252, embedded labels, delimiter is ',', msq);

 

Table2:

LOAD Field3, Field4

FROM DataFile2.csv

(txt, codepage is 1252, embedded labels, delimiter is ',', msq)

WHERE NOT WildMatch(Field3, '*-*');

 

LeftJoin:

LOAD Field1, Field2, Field4

RESIDENT Table1

LEFT JOIN

Table2

WHERE NOT IsNull(Field3);

 

DROP TABLE Table1, Table2;

Kelly_Anne001
Contributor
Contributor
Author

Thank you so much.

I will give it a try and let you know how it goes.

I am still learning and playing around with it.