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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 624 views
  • 0 likes
  • 2 in conversation