Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Year | Month | Volume |
2020 | 1 | 10 |
2020 | 2 | 20 |
2020 | 3 | 30 |
2020 | 4 | 40 |
2020 | 5 | 50 |
2020 | 6 | 60 |
2020 | 7 | 70 |
2020 | 8 | 80 |
2020 | 9 | 90 |
2020 | 10 | 100 |
2020 | 11 | 110 |
2020 | 12 | 120 |
now my required result for this table will be-
Year | Month | Volume | Incentive |
2020 | 1 | 10 | 10 |
2020 | 2 | 20 | 30 |
2020 | 3 | 30 | 60 |
2020 | 4 | 40 | 100 |
2020 | 5 | 50 | 150 |
2020 | 6 | 60 | 210 |
2020 | 7 | 70 | 280 |
2020 | 8 | 80 | 360 |
2020 | 9 | 90 | 450 |
2020 | 10 | 100 | 550 |
2020 | 11 | 110 | 660 |
2020 | 12 | 120 | 780 |
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
@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;
@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;
Thanks a lot @Kushal_Chawda it just perfectly worked.😊😊