BookmarkSubscribeRSS Feed
UshaLatha
Obsidian | Level 7

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.

 

1 REPLY 1
ballardw
Super User

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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 717 views
  • 0 likes
  • 2 in conversation