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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.