BookmarkSubscribeRSS Feed
Ming80
Calcite | Level 5

Hi everyone,

 

I am completely new to SAS VA . I some transaction operation data (50k rows in 2 years) and I would like to use SAS VA to create a executive report to create reports with graphs which show (compare) metric for each week.

 

weekly graph.PNG

3 REPLIES 3
Sam_SAS
SAS Employee

You can make a stacked bar chart like the one in your screen capture:

 

bar.png

 

Make a bar chart and assign a category to the Group role. Set the Grouping Style option to stack the group values, and set the Grouping Scale option to Normalize to 100%.

 

You can also set a Week format on your date variable to give values like 22W04. I'm not sure if there is an easy way to get weekly values labeled with the first day of the week (01/03/2022)

 

Let us know if that helps,

Sam

Ming80
Calcite | Level 5

Hi Sam,

 

Thank you for your reply. I think my biggest problem now is that I don't know how to group/filter transactional data into each week. 

 

Sam_SAS
SAS Employee

If you are fine with the "22W01" style of weekly date values, all you need to do is assign a weekly format to your date column.

 

If it is a requirement to have standard date values to represent each week, AND you have VA 8.3 or later, then here is one way to do it:

 

barweek1.png

 

You need a calculated item and an advanced filter to get this. 

 

First we will create a calculated expression so that every row will contain the value for the entire week:

barweekexp.png

The Period() operator aggregates the values for the current time period. We need to select _ByWeek_ for the final drop-down here. If your VA is older than the 8.3 release, weekly intervals are not supported and this won't work.

 

So now that we have a column that has each week's total, we'll want to hide all the date values other than the day of the week we want to show. We'll use an advanced filter to do this:

barweekaf.png

You make a filter like this by opening the Filters pane and selecting New Filter... Advanced Filter.

This filter uses the DayofWeek() operator and I am selecting "2" which is Monday. So each date displayed in your chart will be a Monday.

 

So if you create your bar chart using the calculated item above, and you apply the filter, then you can get a result like the bar chart at the top of this post.

 

Let us know if that helps,

Sam

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3 replies
  • 926 views
  • 2 likes
  • 2 in conversation