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.