BookmarkSubscribeRSS Feed
saspert
Pyrite | Level 9

Hi,

I have data for 6 months. I am trying to create a bar chart that shows current month vs previous month. So if I add a section prompt, the bar chart should show only 2 bars. The first month is easy. How do I create the second bar that points to the previous months data and place it adjacent to the current month?

ALTERNATIVE is ok too - I have 2 date variables (week of, date aired). I have a categorical variable Month (Jan - Jul). The custom calculation I am trying to do is on a measure "actual spend". When right click and try this option on Actual spend, I choose "create" -> "% difference from the previous month" but it lets me use only the 2 date variables but not the categorical variable month. I tried creating a duplicate date variable frm the "week of" and display as month using the format options. But still the custom category would not allow me to choose the new date variable.

How do I create the % difference of a measure (actual spend) at the weekly and monthly level? using any combination of the date variable (week of) and categorical variable (month)?

So I tried my best to create the custom category. this is the formula I got -

RelativePeriod(_Average_, 'Actual Spend'n, 'Week Of'n, _Inferred_, -1, _Full_, {Date}) )

but it  is not working correctly. for the first row, it gives a % but is . for all others.

Is there a lag function in SAS VA 7.1

Thanks,
saspert

Message was edited by: Raj Addepalli as on 08/04/2015

Message was edited by: Raj Addepalli

4 REPLIES 4
TejaSurapaneni
Lapis Lazuli | Level 10

Hello,

Which version you are using?

You can use List (Controls) instead of drop down list in section prompts.

But every month you have to change the dates, it would not be automated.

Can you share "Week of" Logic.

Thanks & Regards,

Teja Surapaneni.

saspert
Pyrite | Level 9

My idea is to automate it. I eventually changed the drop down to check box so that multiple months can be displayed. But I was trying to see if only 2 months (current and previous) can be shown at a time.

Alternatively, how do I create a custom category that points to the previous month when the original category points to current month? I guess if the custom category can be built, it will be a simple matter of adding to the graph. Sorry for asking the same question in a different manner.

saspert
Pyrite | Level 9

I am SAS VA 7.1

Explore_SAS
Obsidian | Level 7

I would suggest filter the data for a data range for which you are looking to see the report and try to add month as lattice column in the bar chart that will show both months on the chart.

let us know, if it helps.

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
  • 4 replies
  • 1785 views
  • 0 likes
  • 3 in conversation