Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, i got problem with joining tables depend on period.
TAB1:
DATE_FROM | DATE_TO | KEY | PERIOD_ID | EMPL_NO |
02.01.1996 | 31.12.2006 | 2385#35066 | 170645 | 2385 |
02.01.1996 | 31.12.2006 | 2385#35066 | 172440 | 2385 |
02.01.1996 | 31.12.2006 | 2385#35066 | 178747 | 2385 |
16.07.2008 | 31.01.2010 | 2385#39645 | 206095 | 2385 |
16.07.2008 | 31.01.2010 | 2385#39645 | 213418 | 2385 |
30.11.2018 | 2385#43434 | 260321 | 2385 | |
30.11.2018 | 2385#43434 | 261284 | 2385 |
TAB2:
DATE_FROM | DATE_TO | KEY | PERIOD_ID | EMPL_NO |
01.01.2007 | 31.12.2007 | 2385#ZEWN | 178599 | 2385 |
01.04.2007 | 30.04.2007 | 2385#ZEWN | 178299 | 2385 |
01.01.2009 | 31.12.2009 | 2385#ZEWN | 178300 | 2385 |
DESTINATION_TAB:
DATE_FROM | DATE_TO | KEY | PERIOD_ID | EMPL_NO |
02.01.1996 | 31.12.2006 | 2385#35066 | 170645 | 2385 |
02.01.1996 | 31.12.2006 | 2385#35066 | 172440 | 2385 |
02.01.1996 | 31.12.2006 | 2385#35066 | 178747 | 2385 |
16.07.2008 | 31.01.2010 | 2385#39645 | 206095 | 2385 |
16.07.2008 | 31.01.2010 | 2385#39645 | 213418 | 2385 |
30.11.2018 | 2385#43434 | 260321 | 2385 | |
30.11.2018 | 2385#43434 | 261284 | 2385 | |
01.01.2007 | 31.12.2007 | 2385#ZEWN | 178599 | 2385 |
01.04.2007 | 30.04.2007 | 2385#ZEWN | 178299 | 2385 |
01.01.2009 | 31.12.2009 | 2385#39645 | 178300 | 2385 |
In TAB1 and TAB2 I got series of periods which correspond with KEY and EMPL_NO, tables should be join when period from TAB2 is included in any periods in TAB1, KEY should be taken from TAB1, when period from TAB2 not exist in TAB1 KEY should be taken from TAB2 - how can I get this table join ??
Regards
thanks for replay, finally i've got another solution (temporary table with additional Key and compare date with period)
Regards
I found INTERVALMATCH prefix - and maybe this prefix can be used... But i'm new to qlikview and don't know how to exactly use it in above example...
Here are some Design Blog posts that may help you out!
https://community.qlik.com/t5/Qlik-Design-Blog/Using-IntervalMatch/ba-p/1475510
https://community.qlik.com/t5/Qlik-Design-Blog/IntervalMatch/ba-p/1464547
I know this one can be tricky, the last time I had to use it, took me a bit to get everything sorted out, so hopefully these may help you get your problem solved.
Regards,
Brett
thanks for replay, finally i've got another solution (temporary table with additional Key and compare date with period)
Regards