Greetings!
I'm trying to get previous date value via set analysis in straight table.
I get expression/variable for previous date (column 5):
v_prev_m =if(Dimensionality()=0,
Date(MonthEnd(AddMonths(Min(CurDate),-1))),
Date(MonthEnd(AddMonths(CurDate,-1))))
Expression for previous month value (column4):
=Sum(
Aggr(
Sum({<CurDate={"$(=v_prev_m)"}>}Fact),
Territory))
Everything works pretty nice if I choose only one date (field 'CurDate').
But if i will choose two or more fields in 'CurDate', then expression works only for first row.
And variable in expression calculate only for first row, although in column 5 it estimates for every row.
Is there any ways to make it right?
So, if somebody could help I really appreciate.
Thanks in advance, Andrey
See this document: Calculating rolling n-period totals, averages or other aggregations