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: 
Not applicable

Interval match??

Hi All

I have the listed requirement. I want the part highlighted in BOLD in my chart. Can i use interval match if so how do I do it?

Thanks

4 Replies
german24
Partner - Contributor III
Partner - Contributor III

Hi,

try this...

Sin título.png

Not applicable
Author

Sorry, did I miss the qvw???

Thanks

aarkay29
Specialist
Specialist



Rate:

Mapping Load * Inline [

Yrs, Rate

0 to 1, 0.9

1 to 3, 2.25

3 to 5, 4.05

];

Temp:

Load * Inline [

Term, Yrs

0-370, 0 to 1

371-1105, 1 to 3

1106-1831, 3 to 5

];

Table:

Load * Inline [

Name, Amount, Termdays

ABC, 100, 170

DEF, 200 ,   1200

];

INNER Join(Table)

IntervalMatch (Termdays)

Load

  SubField(Term,'-',1) as From,

  SubField(Term,'-',2) as To

Resident

  Temp;

Temp2:

Load

Name,Amount,Termdays,From&'-'&To as Term

Resident

  Table;

Drop Table

  Table;

Left Join(Temp2)

Load

  Term,

  Yrs

Resident

  Temp;

Drop Table

  Temp;

FinalTable:

Load

Name,Amount,Termdays,Amount*Rate as Fee;

Load

  Name,Amount,Termdays,Term,Yrs,

  ApplyMap('Rate',Yrs) as Rate

Resident

  Temp2;

Drop Table

  Temp2;

german24
Partner - Contributor III
Partner - Contributor III

QVW

Best regards,

German