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-2024.png

 

Secure your spot at the must-attend AI and analytics event of 2024: SAS Innovate 2024! Get ready for a jam-packed agenda featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events.

 

Register by March 1 to snag the Early Bird rate of just $695! Don't miss out on this exclusive offer. 

 

Register now!

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