Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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;
BonusId | Bonus |
1 | 75% |
1 | 100% |
2 | 75% |
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;
Hi Kamal,
Please fiend the attachment of application.