Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
chrisk44
New Contributor III

Joining 2 tables with periods

Hello all,

I've got  2 tables:

TAB1:

IND_DT_POCZ_ZATR IND_DT_KONC_ZATR IND_KLUCZ_ZAT IND_PRC_NUMER IND_STATUS IND_ZAT_FRM_ID 
1996-01-02 01:002006-12-31 01:002385#35066#1238511
2008-07-16 02:002010-01-31 01:002385#39645#1238511
2018-11-30 01:00 2385#43434#1238511
  2385#UMC238501

 

TAB2:

AB_DATA_OD AB_ID IND_PRC_NUMER 
1997-01-02 01:0012024992385
2004-07-19 02:008413882385
2006-08-14 02:0012429052385
2009-11-01 01:0013393652385
2019-03-04 01:0015616882385

 

DESTINATION TABLE:

AB_DATA_OD AB_ID IND_PRC_NUMER IND_KLUCZ_ZAT 
1997-01-02 01:00120249923852385#35066#1
2004-07-19 02:0084138823852385#35066#1
2006-08-14 02:00124290523852385#35066#1
2009-11-01 01:00133936523852385#39645#1
2019-03-04 01:00156168823852385#43434#1

 

 

I try script:

TAB3:
IntervalMatch("AB_DATA_OD",IND_PRC_NUMER)
LOAD
IND_DT_POCZ_ZATR,
IND_DT_KONC_ZATR,
IND_PRC_NUMER
Resident TAB1 where IND_STATUS=1;

inner Join(TAB2)
LOAD
IND_PRC_NUMER,
IND_DT_POCZ_ZATR
Resident TAB3;

but results are:

AB_DATA_OD AB_ID IND_PRC_NUMER IND_KLUCZ_ZAT 
1997-01-02 01:00120249923852385#35066#1
1997-01-02 01:00120249923852385#43434#1
2004-07-19 02:0084138823852385#35066#1
2004-07-19 02:0084138823852385#43434#1
2006-08-14 02:00124290523852385#35066#1
2006-08-14 02:00124290523852385#43434#1
2009-11-01 01:00133936523852385#35066#1
2009-11-01 01:00133936523852385#43434#1
2019-03-04 01:00156168823852385#35066#1
2019-03-04 01:00156168823852385#43434#1

 

Any help will be appreciated 🙂

Regards

 

1 Reply
anushree1
Valued Contributor

Re: Joining 2 tables with periods

please check the attached