BookmarkSubscribeRSS Feed
NareshAbburi
Calcite | Level 5

Hi ,

I'm plotting a graph using SGPLOT like below, and I'm getting the good graph with all the clients groups.

Now I want to see along with my individual client performance, I'd like to see the total performance in the same plot.

Please let me know which option should I use to get this result.

PROC SGPLOT DATA = DATA;

SCATTER Y = PERCENT X = CLIENT/ GROUP = PULL_TYPE GROUPORDER = DESCENDING MARKERATTRS = (SYMBOL = TRIANGLEFILLED);

RUN;

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

You can put another graph over the top of the previous one:

PROC SGPLOT DATA = DATA;

SCATTER Y = PERCENT X = CLIENT/ GROUP = PULL_TYPE GROUPORDER = DESCENDING MARKERATTRS = (SYMBOL = TRIANGLEFILLED);

scatter y=xxx x=yyy / ...;

RUN;

You may also like to have a look at this blog, which has hundreds of examples for sgplot/template:

http://blogs.sas.com/content/graphicallyspeaking/

DanH_sas
SAS Super FREQ

Here is a way using a needle plot to create a summary bar at the end.

data class;

set sashelp.class (where=(sex eq 'M')) end=_last_;

retain _sum_ 0;

_sum_=_sum_+weight;

output;

if (_last_) then do;

  name="Total";

  weight=.;

  total=_sum_;

  output;

end;

run;

proc sgplot data=class;

scatter x=name y=weight;

needle x=name y=total / y2axis lineattrs=(thickness=20);

run;

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

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
  • 2 replies
  • 907 views
  • 0 likes
  • 3 in conversation