BookmarkSubscribeRSS Feed
JoshB
Quartz | Level 8

Is there a way in VA to calculate a fix period moving average. 

 

In the example below, it would be a 6 week moving average.

It wouldn't matter if the by group that hadn't observered 6 weeks of data yet were missing as below.

 

Category	Brand	Week	Measure	MA
Cookies	Brand1	1/3/2015	8583	*
Cookies	Brand1	1/10/2015	812	*
Cookies	Brand1	1/17/2015	827	*
Cookies	Brand1	1/24/2015	2323	*
Cookies	Brand1	1/31/2015	5256	*
Cookies	Brand1	2/7/2015	13712	5252 ((8583+812+827+2323+5256+13712)/6)
Cookies	Brand1	2/14/2015	14348	6213 ((812+827+2323+5256+13712+14348)/6)
Cookies	Brand1	2/21/2015	1654	6353
Cookies	Brand2	1/3/2015	11074	*
Cookies	Brand2	1/10/2015	12299	*
Cookies	Brand2	1/17/2015	12689	*
Cookies	Brand2	1/24/2015	5140	*
Cookies	Brand2	1/31/2015	15695	*
Cookies	Brand2	2/7/2015	11048	11324
Cookies	Brand2	2/14/2015	3898	10128
Cookies	Brand2	2/21/2015	4959	8905

 

 

We are currently on VA 7.1

2 REPLIES 2
Sam_SAS
SAS Employee

Hi Josh,

 

I don't think there is an easy way to do this within the VA designer interface.

 

I believe it should be possible to calculate the moving average as part of your data query using PROC SQL or PROC TIMESERIES.

 

Thanks,
Sam

Explore_SAS
Obsidian | Level 7

Can you try using the RelativePeriod in the New Aggregated column, see if its work for you.

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
  • 1257 views
  • 0 likes
  • 3 in conversation