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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need an example of extended interval match

Need an example of extended interval match

5 Replies
MK_QSL
MVP
MVP

Purchase:

Load * Inline

[

  Supplier, Purchase

  ABC, 125

  DEF, 115

];

Discount:

Load * Inline

[

  Supplier, From, To, Discount

  ABC, 100, 119, 2%

  ABC, 120, 129, 3%

  ABC, 130, 150, 4%

  DEF, 110, 119, 4%

  DEF, 120, 129, 6%

  DEF, 130, 150, 8%

];

INNER JOIN IntervalMatch (Purchase,Supplier) Load From, To, Supplier Resident Discount;

Join (Purchase) Load * Resident Discount;

Drop Table Discount;

Drop Fields From,To;

Not applicable
Author

Thanks for the example!

To explain my scenario, I am modifying below example.

I want the discount to be displayed with respect to each supplier.

Supplier1 | Discount1| Supplier2|Disocunt2|......................

Purchase:

Load * Inline

[

  Supplier1,Supplier2, Supplier3,Purchase

  ABC, XYZ,EWQ,125

  DEF,FRT, YUT,115

];

Discount:

Load * Inline

[

  Supplier, From, To, Discount

  ABC, 100, 119, 2%

  ABC, 120, 129, 3%

  ABC, 130, 150, 4%

  DEF, 110, 119, 4%

  DEF, 120, 129, 6%

  DEF, 130, 150, 8%

  XYZ, 110,130,5%

  XYZ, 110,130,5%

  XYZ, 100,120,5%

  FRT,110,140, 2%

  FRT,110,112, 2%

  EWQ,110,140, 2%

  EWQ,110,140, 2%

EWQ,110,140, 2%

YUT,105,118,6%

];

Wondering how to depict this in current code?

MK_QSL
MVP
MVP

Purchase:

CrossTable(SupplierNo, Supplier,2)

Load RowNo() as ID, Purchase, Supplier1,Supplier2, Supplier3 Inline

[

  Supplier1,Supplier2, Supplier3,Purchase

  ABC, XYZ,EWQ,125

  DEF,FRT, YUT,115

];

Discount:

Load * Inline

[

  Supplier, From, To, Discount

  ABC, 100, 119, 2%

  ABC, 120, 129, 3%

  ABC, 130, 150, 4%

  DEF, 110, 119, 4%

  DEF, 120, 129, 6%

  DEF, 130, 150, 8%

  XYZ, 110,130,5%

  XYZ, 110,130,5%

  XYZ, 100,120,5%

  FRT,110,140, 2%

  FRT,110,112, 2%

  EWQ,110,140, 2%

  EWQ,110,140, 2%

EWQ,110,140, 2%

YUT,105,118,6%

];

INNER JOIN IntervalMatch (Purchase,Supplier) Load From, To, Supplier Resident Discount;

Join (Purchase) Load * Resident Discount;

Drop Table Discount;

Drop Fields From,To;

Not applicable
Author

Hi Manisch, I am new to qlikview.

I have taught myself some fundementals within this area.

But, can u exactly explain the script u posted ?

What does it do , from crosstable function to the intervalmatch function.

Thanks!