Dear all,
I have a proc gchart with vbar, group and subgroup. The type is percent. If I don't add anything then 100% is the whole chart. If I add the option g100 then 100% is within one group. Now, my customer wants 100% per bar in this chart. Is that possible?
Best wishes
Eva
Is that it?
A code example of what you attempted would be helpful.
proc gchart data=sashelp.cars (where=(make in ("Audi","BMW")));
vbar make / freq = enginesize
group = type
subgroup = cylinders
type=percent
g100 /* effect: one group=100% , but I need one bar=100% */
;
run;
quit;
Is that it?
Yes! I always searched for a vbar Option... But a proc freq before the proc gchart is best 🙂
Thanx for your help data_null_.
I'm not sure quite what you want but if each bar should total to 100 across the cylinder count you may need to process your data a bit before taking it to GCHART.
Maybe this is what you are looking for?
proc freq data=sashelp.cars (where=(make in ("Audi","BMW"))) noprint;
table make* type *cylinders/ outpct out=work.cars;
run;
proc gchart data=work.cars (where=(make in ("Audi","BMW")));
vbar make / sumvar=Pct_row
group = type
subgroup = cylinders
type=sum
;
label pct_row='Percent of Engine Cylinders' ;
run;
quit;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.