Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conditional Joining in Qlikview

Hi,

we have two below tables

Table 1:

ItemTariffStart DateEnd Date
N001501-Jan-121-May-12
N001551-May-1231-Dec-99

Table 2:

ItemMRDateQty
N0013-Jan-125
N0014-Feb-129
N0016-May-1220

Table 1 is tariff table and our tariff is expired on specific time and table 2 is our transnational table.

We want to join them on the base of Item and MRdate which means that MRDate must lie between Start Date and End Date of Table2.

If I create there query on SQL that is like { select a.Item, a.MRDate, a.Qty, b.Tariff from Table1 A join Table2 B on (a.item = b.item and a.MRDate between b."Start Date" and "End Date") }

Please tell me how is it possible on qlikview.

Our Result like that....

Item

MRDate

Qty

Tarif

N001

3-Jan-12

5

50

N001

4-Feb-12

9

50

N001

6-May-12

20

55

Thank You

1 Solution

Accepted Solutions
salto
Specialist II
Specialist II

Hi,

you should use intervalmatch for this;

join intervalmatch (MRDate, Item) load StartDate, EndDate, Item resident TariffTable;

LEFT JOIN (Transactions) load * RESIDENT TariffTable;

DROP TABLE TariffTable;

Hope this helps!

View solution in original post

3 Replies
tresesco
MVP
MVP

Try IntervalMatch()

salto
Specialist II
Specialist II

Hi,

you should use intervalmatch for this;

join intervalmatch (MRDate, Item) load StartDate, EndDate, Item resident TariffTable;

LEFT JOIN (Transactions) load * RESIDENT TariffTable;

DROP TABLE TariffTable;

Hope this helps!

Not applicable
Author

Great Thanks thats working......