Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
kamalqlik
Partner - Specialist
Partner - Specialist

Interval Match

Hi Friends,

I have two table

Users:

LOAD * Inline

[

UserID, Quarter, Hours, BonusId

123,Q1-2011,122,1

224,Q1-2011,103,1

234,Q2-2011,97,2 ];

Bonus:

load * inline

[

BonusId,From_Hours,To_Hours,Bonus

1,75,100,75%

1,101,125,100%

2,79,104,75%

2,105,130,100%];

I want to determine the correct bonus for each user based on the user's hours.How can i do that using Interval Match

Regards

Kamal

1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi Kamal,

 

     Please fiend the attachment of application.

View solution in original post

3 Replies
Not applicable

a:

LOAD * INLINE [

    UserID, Quarter, Hours, BonusId

    123, Q1-2011, 122, 1

    224, Q1-2011, 103, 1

    234, Q2-2011, 97, 2

];

b:

LOAD * INLINE [

    BonusId_new, From_Hours, To_Hours, Bonus

    1, 75, 100, 75%

    1, 101, 125, 100%

    2, 79, 104, 75%

    2, 105, 130, 100%

];

DATA:

IntervalMatch(Hours)

LOAD From_Hours, To_Hours

Resident b;

BonusIdBonus
175%
1100%
275%
er_mohit
Master II
Master II

hiii try this

Users:

LOAD * Inline

[

UserID, Quarter, Hours, BonusId

123,Q1-2011,122,1

224,Q1-2011,103,1

234,Q2-2011,97,2 ];

Bonus:

load * inline

[

BonusId,From_Hours,To_Hours,Bonus

1,75,100,75%

1,101,125,100%

2,79,104,75%

2,105,130,100%];

Left Join(Bonus)

IntervalMatch(Hours)

LOAD

From_Hours,To_Hours

Resident Bonus;

Anonymous
Not applicable

Hi Kamal,

 

     Please fiend the attachment of application.