BookmarkSubscribeRSS Feed
AmitKB
Fluorite | Level 6
Hi all,
I want to create a sgpanel vbar graph by region, where the sas dataset is in following format. I dont know how to assign the response in the vbar.

Region qtr1 qtr2 qtr3 qtr4 <-- variable names
East 20 10 30 40
West 10 40 30 10
North 50 20 60 30
South 30 10 20 60

Thanks for all your help.

Regards,

Amit
2 REPLIES 2
DanH_sas
SAS Super FREQ
You just need to transpose your data. Here's a simple example using your posted data:

data test;
input region $ qtr1 qtr2 qtr3 qtr4;
cards;
East 20 10 30 40
West 10 40 30 10
North 50 20 60 30
South 30 10 20 60
;
run;

proc transpose data=test out=transposed;
by region notsorted;
var qtr1 qtr2 qtr3 qtr4;
run;

proc sgpanel data=transposed;
panelby region;
vbar _name_ / response=col1;
run;
AmitKB
Fluorite | Level 6
Hi Dan,
Thanks for the solution. Its works great.

I appreciate all your help.

Regards,

Amit

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 947 views
  • 0 likes
  • 2 in conversation