Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to calculate amount for last two months.
I have month and amount field. I need to calculate the amount for last two months, like I need to calculate amount for march and april. How to do this in the expression of a chart?
It may be as simple as going to the Expressions tab, selecting Accumulate for that expression, and entering 2 for Steps Back.
It may look like this, assuming that in May you want to see March and April:
sum(if(Date>=monthstart(addmonths(today(), -2)) and Date <=monthend(addmonths(today(), -1)), Amount))
John's solution looks simpler - that means better, if it works for you.
Hi
Try like this
=sum({<YEAR={">=$(=(AddMonths(Max(YEAR),-2)))<=$(=(AddMonths(Max(YEAR),-1)))"}>}SAL
Regards,
Mahesh.