Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Joining Tables

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_NumberStart_TimeEnd_Time
00011/1/201329/12/2013
00011/3/20121/9/2012
00025/6/20134/6/2014

                                       

Policy_NumberOccurrence_Time
00011/1/2013
00025/6/2013
00015/5/2012
4 Replies
pokassov
Specialist
Specialist

Hi!

t1:

load *

from

<your table2>;

Inner Join (t1) IntervalMatch (Occurence_Time,Policy_Number) LOAD Start_Time, End_time, Key

from

<your table1>;

Sergey

sunny_talwar

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:

IntervalMatch.PNG

HTH

Best,

Sunny

Anonymous
Not applicable
Author

Thank you sergey

Anonymous
Not applicable
Author

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.