Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Qlikview : Conditional join QVD

Hi,

Please give me some input on these :

I have a table 1 (fields : start_time) and table 2 (fields : start_time, end_time)

i wanted to join them like this :

SQL statement :

select *

from table1 a

join table2 b

on a.start_time<= b.start_time AND b.start_time <= a.end_time

qlikview statement :

?

Thanks,

4 Replies
er_mohit
Master II
Master II

qualify *;

a:

load start_time,

x,

y,

z;

sql select * from a;

join

qualify *;

b:

load start_time,

end_time,

d,

e;

SQL Select *

from b;

new:

load * from a

where a.start_time<= b.start_time AND b.start_time <= a.end_time;

hope it helps

Not applicable
Author

a:

load

rowno() as key,

start_time as start_time_a,

end_time as end_time_a;

sql select * from table a;

b:

join(a)

load

rowno() as key

start_time as start_time_b

end_time as end_time_b

sql select * from table b;

load *

resident a

where start_time_a <= start_time_b  and  start_time_b <= end_time_a

daveamz
Partner - Creator III
Partner - Creator III

Hi,

You can use intervalmatch. See: http://community.qlik.com/blogs/qlikviewdesignblog/2013/04/04/intervalmatch

Regards,

David

Not applicable
Author

try the below one...

table1:

LOAD a_starttime,a_endtime,'a' as dummy;    
SQL  SELECT * FROM table1 
join table
 
table2

LOAD b_starttime,b_endtime,'a' as dummy;    
SQL  SELECT * FROM table2

table3:

load *
resident table1 where a_starttime<= b_starttime AND b_starttime <= a_endtime

drop tables table1