I would like to plot a series of revenue data on quarter and year using proc sgplot. The data I have is like the following:
In Excel, I can make a series like the following:
However, I can't figure out how to make X axis having quarter and year using proc sgplot like it did in Excel. Any tricks here please?
Here is one way:
proc sgpanel data=sashelp.prdsale; panelby year / layout=columnlattice noheaderborder colheaderpos=bottom novarname; colaxis display=(nolabel) values=(1 2 3 4) valuesdisplay=("Q1" "Q2" "Q3" "Q4"); vline quarter / response=actual markers; run;
In your case, you have Q1-Q4 in your data instead of 1-4, so you can drop the VALUES and VALUESDISPLAY option.
Hope this helps!
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.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.