This gets you some of the way at least
proc freq data=have noprint;
tables year*Group_Y_Name*Rankle / out=temp outpct;
run;
data graph;
set temp;
pct_row=round(pct_row)/100;
run;
title 'Group Y Portfolio (2007 / 2008 / 2009 / 2010)';
proc sgpanel data=graph;
styleattrs datacolors=(CXFFDAB9 CXADD8E6 CXFAFAD2);
panelby Group_Y_Name / layout=columnlattice novarname noborder colheaderpos=bottom;
vbar Year / response=pct_row group=Rankle stat=sum seglabel seglabelformat=percent.;
colaxis display=(nolabel);
rowaxis display=(nolabel);
keylegend / noborder title='';
run;
title;
This gets you some of the way at least
proc freq data=have noprint;
tables year*Group_Y_Name*Rankle / out=temp outpct;
run;
data graph;
set temp;
pct_row=round(pct_row)/100;
run;
title 'Group Y Portfolio (2007 / 2008 / 2009 / 2010)';
proc sgpanel data=graph;
styleattrs datacolors=(CXFFDAB9 CXADD8E6 CXFAFAD2);
panelby Group_Y_Name / layout=columnlattice novarname noborder colheaderpos=bottom;
vbar Year / response=pct_row group=Rankle stat=sum seglabel seglabelformat=percent.;
colaxis display=(nolabel);
rowaxis display=(nolabel);
keylegend / noborder title='';
run;
title;
It works fine. Thank you so much.
Is there anyway to acheive the same results in GCHART?
You're welcome 🙂 Probably. I'm no expert in PROC GCHART. Also, the SG Procedures are newer and better documented.
@Rajeshthangam wrote:
It works fine. Thank you so much.
Is there anyway to acheive the same results in GCHART?
No. SAS University Edition does not include the SAS/Graph part that would be needed to use the much less capable GCHART.
Thank you so much for giving this logic. But, Can you please remove the sample data and expected output image given?
Done
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.