Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ajithsachin
Partner - Contributor II
Partner - Contributor II

Interval Match

Hi All,

     i have two tables as below mentioned.

    

     MARK:

MARKVARIANCE_PERCENTAGE
1000
1005
9010
8015

    

     FILL:

VENDORVARIANCE
16

in my load script i need to get the mark as per the variance percentage from the FILL table

means i need the result like this.

VENDORVARIANCEMARK
1690

because variance is in between 5 and 10 so need to give 90 marks.

how i can write a script for this while loading the data..can anybody help please..

Regards,

Ajith

1 Solution

Accepted Solutions
hic
Former Employee
Former Employee

You could do it the following way:

  1. Create intervals in you "Marks" table (see http://community.qlik.com/blogs/qlikviewdesignblog/2013/02/25/creating-intervals-from-change-dates how to do this)
  2. Load Your "Fill" table as it is
  3. Use IntervalMatchto create a third table to link the two above tables
    IntervalMatch (VARIANCE) Load From, To Resident Marks;

HIC

View solution in original post

4 Replies
Gysbert_Wassenaar

Try using a mapping table instead of intervalmatch:

MarkMap:

load * inline [

Variance, Mark

0, 100

5, 100

10, 90

15, 80

];

Fill:

load Vendor, Variance, applymap('MarkMap', ceil(Variance,5)) as Mark

from ...mysource...;


talk is cheap, supply exceeds demand
ajithsachin
Partner - Contributor II
Partner - Contributor II
Author

Dear Gysbert Wassenaar,

Thanks for ur reply..

     we cannot hardcode ceil(Variance,5) because range may be of different scale.

     and this applymap function also not giving me the mark.

hic
Former Employee
Former Employee

You could do it the following way:

  1. Create intervals in you "Marks" table (see http://community.qlik.com/blogs/qlikviewdesignblog/2013/02/25/creating-intervals-from-change-dates how to do this)
  2. Load Your "Fill" table as it is
  3. Use IntervalMatchto create a third table to link the two above tables
    IntervalMatch (VARIANCE) Load From, To Resident Marks;

HIC

ajithsachin
Partner - Contributor II
Partner - Contributor II
Author

Thanks Henric Cronström

It is working fine..