Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I am trying to connect two tables, the problem is there are two column in First table which are Start time and End time, in Second table i have column which is Occurrence time. This two table must be connected with concatenation of Policy_Number and if occurrence date is between start and end time.
Policy_Number | Start_Time | End_Time |
---|---|---|
0001 | 1/1/2013 | 29/12/2013 |
0001 | 1/3/2012 | 1/9/2012 |
0002 | 5/6/2013 | 4/6/2014 |
Policy_Number | Occurrence_Time |
---|---|
0001 | 1/1/2013 |
0002 | 5/6/2013 |
0001 | 5/5/2012 |
Hi!
t1:
load *
from
<your table2>;
Inner Join (t1) IntervalMatch (Occurence_Time,Policy_Number) LOAD Start_Time, End_time, Key
from
<your table1>;
Sergey
Table1:
LOAD Policy_Number,
Start_Time,
End_Time
FROM
[https://community.qlik.com/thread/158879]
(html, codepage is 1252, embedded labels, table is @1);
Table2:
LOAD Policy_Number,
Occurrence_Time
FROM
[https://community.qlik.com/thread/158879]
(html, codepage is 1252, embedded labels, table is @2);
Join (Table1)
IntervalMatch(Occurrence_Time, Policy_Number) LOAD Start_Time, End_Time, Policy_Number Resident Table1;
DROP Table Table2;
Output will look like this:
HTH
Best,
Sunny
Thank you sergey
Thank you sunny, what if i had more column in both table, because i only brought the column that in need to be connect in this question. for example, table one has name,id,date and so on but i dont want them to be used as key.