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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1128 views
  • 0 likes
  • 2 in conversation