Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Yashwanth_
Contributor
Contributor

Joins with Or Condition

Hi ,

I have Two tables from sql .

Table1:

select 

Filed A_Table1,

Filed B_Table1,

Nar1,

Nar2,

Fieldc_Table1

from Table 1

left join 

select 

FieldA_table2,

FiledB_table2,

WOTRNO,

WOSWIF,

FiledC_table2

on 

(Nar1 = WOTRNO ) or (Nar1 = WOSWIF);

My question is how to use that left join with or conditions in Qlik sense load editor .

 

Thanks ,

Yashwanth.

1 Reply
chrismarlow
Specialist II
Specialist II

Hi,

I don't think you can do it directly.

Things I have done similar you do two left joins, then load to a new table combining the joined fields to tidy up, so;

1) Join on NAR1=WOTRNO adding WOTRNO prefix to your fields on your second

2) Join on NAR1=WOSWIF adding WOSWIF prefix to your fields on your second table

Ideally then have 'WOTRNO_FieldA_table2' and 'WOSWIF_FieldA_table2' on your first table

3) Then do a load (usually use noconcatenate) with something like this If(WOTRNO_FieldA_table2=null(),WOSWIF_FieldA_table2,WOTRNO_FieldA_table2) as FieldA_table2 for each field

4) Drop tables as needed

Cheers,

Chris.