BookmarkSubscribeRSS Feed
Quartz | Level 8

Hi All,


I want to analysis the Avg sales one week before and after Christmas of the stores.

I have a date, sales, and store columns 

How can I do so? 


I am using SAS VA 7.4 and Viya. 




Super User

I don't have access to or experience with Visual Analytics, however there are a few additional pieces of information you might supply to help someone else answer the question.


First thing is to verify that your dates are actual SAS date values and not character values that look like dates or numeric that look like some date values. A number of 20180604 is not a date value unless it is being displayed with something like the SAS yymmddn8 format.


Second is to clearly define what you mean by "week before Christmas". Do mean the 7 days Dec 18 to Dec 24 or "the Sunday to Saturday preceding Christmas" or possibly some other definition that might involve the days your store is open? And similar for the week after Christmas. Remember that New Years Eve is 6 days after Christmas and New Years Day is 7 days. Do those days count for the "week"? 

Quartz | Level 8

 Hi @ballardw,


Sure would like to clarify more on that.

So the dates are in SAS familiar format and not character or numerical values. I am using ddmmyyd10. format here. I just need to calculate the sales 7 days before and after a particular date(say any holiday).
So trying to figure out if there is a way to store the holiday date in a variable in SAS Visual Analytics 9.4 as a benchmark value for our calculations.

SAS Code example 

Christmas = holiday('christmas', year);

format christmas DDMMYYD10.;
lower_date=intnx('day', christmas , -7);
format lower_date DDMMYYD10.;
upper_date=intnx('day', christmas , 7);
format upper_date DDMMYYD10.;

if lower_date<=date <= christmas then
if christmas<=date <= upper_date then



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
  • 2 in conversation