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 Super FREQ

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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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