Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
tahsin12
Contributor II
Contributor II

Yearly Incentive Calculation in Data model

Hello there,

I'm new to qlikview development. I need help regarding a requirement. I give the requirements given below.Please help.

its a sales table

YearMonthVolume
2020110
2020220
2020330
2020440
2020550
2020660
2020770
2020880
2020990
202010100
202011110
202012120

 

 

now my required result for this table will be-

YearMonthVolumeIncentive
202011010
202022030
202033060
2020440100
2020550150
2020660210
2020770280
2020880360
2020990450
202010100550
202011110660
202012120780

 

the incentive field is the required result. The full calculation should be in qlikview script. I mean it's a back end calculation. Yearly cumulative calculation in qlikview script. Please help me out from this.

Regards

Tahsin12 

@Henric_Cronström @johnw 

Labels (4)
1 Solution

Accepted Solutions
Kush
MVP
MVP

@tahsin12  try below

Data:
LOAD Year, 
     Month, 
     Volume
FROM Source;

Final:
NoConcatenate
LOAD *,
     if(Year<>Previous(Year),Volume,rangesum(Peek(Incentive),Volume)) as Incentive
Resident Data
Order by Year,Month;

DROP Table Data;

View solution in original post

2 Replies
Kush
MVP
MVP

@tahsin12  try below

Data:
LOAD Year, 
     Month, 
     Volume
FROM Source;

Final:
NoConcatenate
LOAD *,
     if(Year<>Previous(Year),Volume,rangesum(Peek(Incentive),Volume)) as Incentive
Resident Data
Order by Year,Month;

DROP Table Data;

View solution in original post

tahsin12
Contributor II
Contributor II
Author

Thanks a lot @Kush  it just perfectly worked.😊😊