Not sure how you had wanted to implement this, but if you were thinking of creating twelve expressions starting with today's month -12 up to the current month to get the rolling monthly numbers, you could use set analysis as follows:
You would then change the -12 parameter on the AddMonths function to -11, -10, etc.
Hope it helps.
So you want to have one total amount for the last 12 months?
In one statement I think the following would work.
Not sure how to use the union operator in Set Analysis to combine this into one statement.
Here is an example of a moving avgerage expression that has the added twist of being dynamic (the slider determines the number of days in the moving average). This is done without Agrr() or set analysis (it dates back pre set anaysis/agg()) instead it uses RangeAverage() and Above().
Sometimes Agg() and set analysis are so powerful they can blind us to other solutions. Just something to think about.
if(TRADE_DATE > min(total TRADE_DATE) + vMovingAvg, rangeavg(above(avg(CLOSE_PRICE),0,vMovingAvg)), null())
=if(TRADE_DATE > min(total TRADE_DATE) + vMovingAvg, TRADE_DATE, null())
I realise that this was an old post, but I hope you can help me as this seems to be the only solution that doesn't require a slider. For some reason the graphics/table you posted are not being displayed. I tried to apply both formulas, but I get "No data to display" message on the graph. Also, I have two moving averages on one graph and your solution seems to provide for one only via a variable.