Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

ON Condition in Join

Hi,

I have 2 tables which I want to join together,

by 2 conditions:

1. Both have the same ID

2. Attribute "Duration" in table 1 is larger then attribute "Day" in table 2

in SQL I would do:

select *

from table1

     JOIN table2

          ON table1.duration>table2.day AND table1.id=table2.id

How do I do it in Qlikview?

*note: I would like to aggregate columns after it

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Temp:

Load   *  From Table1;

Join

Load    * From Table2;

NoConcatenate

Final:

Load * resident Temp where duration>day;

Drop table Temp ;

Assuming id is only common field.

View solution in original post

5 Replies
gautik92
Specialist III
Specialist III

use where condition

alexandros17
Partner - Champion III
Partner - Champion III

I would not use the duration and date information to link the tables, just:

load id,f1,f2,f3 resident table1;

join

load id,f4,f5,f6 resident table2;

tresesco
MVP
MVP

Try like:

Temp:

Load   *  From Table1;

Join

Load    * From Table2;

NoConcatenate

Final:

Load * resident Temp where duration>day;

Drop table Temp ;

Assuming id is only common field.

sasiparupudi1
Master III
Master III

table1:

sql select id,duration from sometable;

noconcatenate

table2:

sql select id,dayfrom someothertable;

noconcatenate

final:

load id,duration resident table1;

join

load id,day resident table2;

where duration>day

hth

Sasi

Anonymous
Not applicable
Author

NoConcatenate!!