I am creating a pie chart to display the space utilized in each of the libraries in GB.
Firstly, I have created a query to get the list of all libraries and space utilized by each of them. By using proc gchart, I am creating a pie chart as well. But the pie chart only gives me the slices of space utilized , How do I get "Others" slice to display the space not utilised.
For example, if the total space available is 500GB, I want the pie chart to display space utilised by A, B, C, D and others.
How can we display the "Other" utilisation when my sql query will not have that detail. I know the total space available 500GB, do I need to calculate the other utilization manually. Please suggest.
My code is as follows:
proc gchart data=work.space_used_by_users;
PIE libvar/
SUMVAR =space_used
TYPE=SUM
NOLEGEND
PERCENT=OUTSIDE
VALUE=NONE
OTHER=4
OTHERLABEL="Other"
COUTLINE=BLACK
NOHEADING;
RUN;
QUIT;
Chart created is attached. Here the total of all the slices sums upto 100%. But the others is missing.
The simplest approach would be to add a record with the amount of space. That would be to subtract the total actually used from the known space. A couple of steps such as Proc summary to get the total used and a data step to the "other" Or a subquery to do the same. Append to your existing graph data set with an appropriate label and not use the OTHERLABEL option.
Any pie chart, and most others, will require an actual value as the graphing procedures can not guess what the total available should be to calculate an other value.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.