BookmarkSubscribeRSS Feed
Frank_Boekamp
Quartz | Level 8

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?

 

 

2 REPLIES 2
Sam_SAS
SAS Employee

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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

Tips for filtering data sources in SAS Visual Analytics

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.

Discussion stats
  • 2 replies
  • 1347 views
  • 0 likes
  • 2 in conversation