Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Pessoal é o seguinte:
I got a data series month to month. There, I have the total of jobs in every december and its balance (could be a positive or negative value) in the other months.
Goal: do a 12 month cumulative sum starting from December of year X to next November X+1. CumSum from December X+1 to November X+2 and so on...
Like the pic above.
How can I solve by scripting?
something like this:
tmp:
LOAD ano_mes, sum(valores) as sumValores FROM ...source... GROUP BY ano_mes;
Result:
LOAD
ano_mes,
If(Right(ano_mes,2)=12, sumValores, rangesum(sumValores, peek(cumsumValores)) as cumsumValores
RESIDENT
tmp
ORDER BY
ano_mes
;
DROP TABLE tmp;
Here is a Design Blog post to check out too:
https://community.qlik.com/t5/Qlik-Design-Blog/The-As-Of-Table/ba-p/1466130
Here is the base URL for this area from which you can search further:
https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog
Here is another site from one of our MVPs that may have some stuff too:
If the other post did work for you, be sure to return to your thread and use the Accept as Solution button on that post to give them credit for the help and let other Members know that worked for you.
Regards,
Brett