Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I calculate a measure that's always looking 4 months backwards?
i.e. October/17 in the chart needs to reflect the measure from June/17
In your expression add set analysis to show "month - 4"
i.e.
Sum({$<Month={'$(=Month-4)'}, Month=>} YourCalculation)
I tried the following and it didn't work:
Count({$<IndDesemb={'S'},DtInc-={'1/1/1900'},
[DtInc.autoCalendar.Month] ={'$(=[DtInc.autoCalendar.Month]-4)'},
[DtInc.autoCalendar.Month]=>} NroProposta)
Does it have to do with using autocalendar fields?
I also tried using the AddMonths function with no success
In your script create a Flag which will be Dynamic always
if(InMonth(DtInc, today() ,-4), 1, 0) as Last4Flag,
In front end use
Count({$<IndDesemb={'S'}, Last4Flag= {1}>} NroProposta)
Try:
Count({$< IndDesemb={'S'}, DtInc={'1/1/1900'}, [DtInc.autoCalendar.Month]={'$(=[DtInc.autoCalendar.Month]-4)'}>}, NroProposta)
The last part stops the calculation looking at month selection so removing this should do it.
[DtInc.autoCalendar.Month]=>} NroProposta)
Try
Count({$<IndDesemb={'S'},DtInc-={'1/1/1900'},
[DtInc.autoCalendar.Month] ={'$(=addmonths(max([DtInc.autoCalendar.Month]),-4)'},
[DtInc.autoCalendar.Month]=>} NroProposta)
The format of your month field could be an issue. So you have some sample data? you may have to do something like date(addmonths(max([DtInc.autoCalendar.Month]),-4),'M/D'YYYY')