I'm using the (new) AggregateCells operator for calculating a moving average in SAS VA 8.3 like below
AggregateCells(_Average_, My measure, default,CellIndex(current, -4), CellIndex(current, 0))
Problem is that the first 4 periods return values instead of missing values. So for example for period 1 the moving average is calculated is an average of just the value of period 1. For period 2 the moving average is calculated is an average of just the values of period 1 and period 2. etc. This is not correct behavior in my opinion: I would not expect to see values for the first 4 periods when using this operator.
What can I do to show correct results?
Hi Frank,
Generally speaking in VA, missing values are ignored when aggregating values. So the average of (., 1, 3) is 2 and not missing.
I believe this is the logic behind returning values for the first four periods in your aggregated item.
I don't think there is a workaround, unless you want to pre-aggregate the moving average in your data prep.
I'll pass on your feedback to the developer.
Thanks,
Sam
Thanks Sam
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.