Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Interval Match

Table 1

    

ProdcutIdPriceDateUnitSale
11501/01/1456840
22506/01/1525625
34609/01/12261196
44801/01/08783744

Table 2

    

ProductIdPrice_AltStart DateEnd Date
11409/01/1304/01/14
11501/01/1401/01/15
11001/01/0901/01/10
11612/01/1306/01/14
22503/01/1512/01/15
22206/01/1512/01/15
22309/01/1512/01/15
22001/01/0901/01/10
34609/01/1212/01/12
44801/01/0801/01/09
44603/01/086/1/2008

Output Table

    

ProductIdPriceDateUnitSalePrice_Alt
11501/01/145684014
22506/01/152562523
34609/01/1226119646
44801/01/0878374448

The Price_Alt value is the Min(Price_Alt) from Table 2 from the Date Period to which the Date field from Table1 belongs.

Not able to get the same using Interval Match

2 Replies
sunny_talwar

Try this:

Table1:

LOAD ProdcutId as ProductId,

    Price,

    Date,

    Unit,

    Sale

FROM

[https://community.qlik.com/thread/237306]

(html, codepage is 1252, embedded labels, table is @1);

Table2:

LOAD ProductId,

    Price_Alt,

    [Start Date],

    [End Date]

FROM

[https://community.qlik.com/thread/237306]

(html, codepage is 1252, embedded labels, table is @2);

Left Join(Table1)

IntervalMatch(Date, ProductId)

LOAD [Start Date],

    [End Date],

    ProductId

Resident Table2;

Left Join (Table1)

LOAD *

Resident Table2;

Right Join (Table1)

LOAD ProductId,

  Min(Price_Alt) as Price_Alt

Resident Table1

Group By ProductId;

DROP Table Table2;


Capture.PNG

Not applicable
Author

That did the Job....Thanks Sunny!!!