BookmarkSubscribeRSS Feed
t75wez1
Pyrite | Level 9

Hi All,

I try to create the two-scale graph(see attached). I wonder if someone has already done it before.

If yes, could share your SAS code here?

 

Thanks a lot.

 

Ethan

2 REPLIES 2
ballardw
Super User

You should provide some example of what your data looks like. Sometimes you need to modify the data structure or add variables to get desired results.

The Proc Sgplot has this example:

 

proc sgplot data=sashelp.stocks (where=(date >= "01jan2000"d
                                 and date <= "01jan2001"d
                                 and stock = "IBM"));
   title "Stock Volume vs. Close";
   vbar date / response=volume;
   vline date / response=close y2axis;
run;
title;

The VBAR to be closer to the example would have a group=variablename , where variable name would be the one holding the values of the August or whatever time period, and groupdisplay=cluster for the side-by-side bars.

 

You should have the sashelp.stocks data set included in your installation.

I am assuming you really don't want the picture of the advertisement in the middle of your graph.

t75wez1
Pyrite | Level 9

Thanks for your example of code and suggestion.

 

Here is the sample of data with Excel format.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1246 views
  • 0 likes
  • 2 in conversation