Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
In this helpfull forum I found an expression that seems to be the solution for what I am looking for.
This is the expression :
=sum(aggr(rangesum(above(total sum({<yearmonthnumber= >}WTF_Totaal),0,12)),yearmonthnumber))
I get strange results however.The cumulative sum has the wrong order. In my app I only have one table. For every %key_kpl /yearmonthnumber there is only one value. No matter what %key_kpl I select, the cumulative sum gets the wrong order at yearmonthnumber 24223.
Yearmonthnumber is calculated in my load script 2018*12+num(right(period,2)) where period is '2018-05' for example.
When I reduce the number of %key_kpl to one or two then the cumulative values are correct. So I assume it has something to do with the sorting in the load script, I tried several sorting but cumulatives remain wrong.
I spent several hours figuring out what the reason of this error can be, but now I am out of ideas.
I hope someone can give me a hint on how to solve this. We are version 12.10.20600.0. of Qlikview
%key_kpl | yearmonthnumber | **bleep** WTF_Totaal | =WTF_Totaal' |
2018-5300 | 24217 | 2.50 | 2.50 |
2018-5300 | 24218 | 5.00 | 2.50 |
2018-5300 | 24219 | 7.50 | 2.50 |
2018-5300 | 24220 | 10.00 | 2.50 |
2018-5300 | 24221 | 12.50 | 2.50 |
2018-5300 | 24222 | 15.00 | 2.50 |
2018-5300 | 24223 | 27.50 | 2.50 |
2018-5300 | 24224 | 30.00 | 2.50 |
2018-5300 | 24225 | 17.50 | 2.50 |
2018-5300 | 24226 | 20.00 | 2.50 |
2018-5300 | 24227 | 22.50 | 2.50 |
2018-5300 | 24228 | 25.00 | 2.50 |
load * inline [ %key_kpl ,yearmonthnumber , WTF_Totaal 2018-5300,24217,25 2018-5300,24218,25 2018-5300,24219,25 2018-5300,24220,25 2018-5300,24221,25 2018-5300,24222,25 2018-5300,24223,25 2018-5300,24224,25 2018-5300,24225,25 2018-5300,24226,25 2018-5300,24227,25 2018-5300,24228,25 2018-5300,24229,25 2018-5300,24230,25 2018-5300,24231,25 2018-5300,24232,25 2018-5300,24233,25 2018-5301,24217,25 2018-5301,24218,25 2018-5301,24219,25 2018-5301,24220,25 2018-5301,24221,25 2018-5301,24222,25 2018-5301,24223,25 2018-5301,24224,25 2018-5301,24225,25 2018-5301,24226,25 2018-5301,24227,25 2018-5301,24228,25 2018-5301,24229,25 2018-5301,24230,25 2018-5301,24231,25 2018-5301,24232,25 2018-5301,24233,25 ];
And the result is below this . After yearmonthnum 24228 the running total should remain 300. (12*25)
%key_kpl | yearmonthnumber | =if(above([%key_kpl])=[%key_kpl] ,rangesum(above(column(1)),WTF_Totaal),sum(WTF_Totaal)) |
2018-5300 | 24217 | 25 |
2018-5300 | 24218 | 50 |
2018-5300 | 24219 | 75 |
2018-5300 | 24220 | 100 |
2018-5300 | 24221 | 125 |
2018-5300 | 24222 | 150 |
2018-5300 | 24223 | 175 |
2018-5300 | 24224 | 200 |
2018-5300 | 24225 | 225 |
2018-5300 | 24226 | 250 |
2018-5300 | 24227 | 275 |
2018-5300 | 24228 | 300 |
2018-5300 | 24229 | 325 |
2018-5300 | 24230 | 350 |
2018-5300 | 24231 | 375 |
2018-5300 | 24232 | 400 |
2018-5300 | 24233 | 425 |
2018-5301 | 24217 | 25 |
2018-5301 | 24218 | 50 |
2018-5301 | 24219 | 75 |
2018-5301 | 24220 | 100 |
2018-5301 | 24221 | 125 |
2018-5301 | 24222 | 150 |
2018-5301 | 24223 | 175 |
2018-5301 | 24224 | 200 |
2018-5301 | 24225 | 225 |
2018-5301 | 24226 | 250 |
2018-5301 | 24227 | 275 |
2018-5301 | 24228 | 300 |
2018-5301 | 24229 | 325 |
2018-5301 | 24230 | 350 |
2018-5301 | 24231 | 375 |
2018-5301 | 24232 | 400 |
2018-5301 | 24233 | 425 |