Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
i have to calculate cumulative sum by month in a linear table and re-starting the sum when the year change.
like this:
year | month | measure | cumulative |
2010 | gen | 6 | 6 |
2010 | feb | 7 | 13 |
2010 | mar | 5 | 18 |
2010 | apr | 8 | 26 |
2010 | mag | 2 | 28 |
2010 | giu | 6 | 34 |
2010 | lug | 6 | 40 |
2010 | ago | 7 | 47 |
2010 | set | 5 | 52 |
2010 | ott | 8 | 60 |
2010 | nov | 2 | 62 |
2010 | dic | 6 | 68 |
2011 | gen | 2 | 2 |
2011 | feb | 7 | 9 |
2011 | mar | 5 | 14 |
2011 | apr | 8 | 22 |
2011 | mag | 2 | 24 |
2011 | giu | 6 | 30 |
2011 | lug | 6 | 36 |
2011 | ago | 7 | 43 |
2011 | set | 5 | 48 |
2011 | ott | 8 | 56 |
2011 | nov | 2 | 58 |
2011 | dic | 6 | 64 |
thank you all
Hi,
Depending on your data model use RangeSum/Above, so something like
rangesum(above(sum(Amount),0,month(Date)))
Cheers,
Chris.
Hi,
Depending on your data model use RangeSum/Above, so something like
rangesum(above(sum(Amount),0,month(Date)))
Cheers,
Chris.
thanks for sharing the logic, I'm also working on something like that and the logic is working correctly when no selection(s) are made but when a user select particular Month/year the results are non cumulative. Hence giving record only for those for which the selection is made and if there is no value for the particular selection then no value.
Hi @chrismarlow when i follow this format to solve thesame problem, it seems to be accumulating from one year to the next in a graph, unless i filter to a specific year then the numbers are accurate, how can i solve this issue pls?