BookmarkSubscribeRSS Feed
Kamohelo_A
Calcite | Level 5

Hi

 

I am trying to create a sas bargraph that one can then filter on to view specific items.

 

Suppose the x-axis is the individual number of passes and the y-axis is the count. Then:

Proc Sgplot Data = Inputs;

      Vbar  = individual_ID;

Run; 

should give me that noting that the individual might say play tennis, rugby, soccer and chess then I can add a Group = sport to get a single bar for an individual with stacks on it?

 

But say I want to filter on just rugby and still track the individual number in the x-axis.

Then finally, what if I want to filter on just on individual number to view more detail into them only across the various sports.

 

Kindly assist on the latter components

 

 

1 REPLY 1
PaigeMiller
Diamond | Level 26

@Kamohelo_A wrote:

Hi

 

I am trying to create a sas bargraph that one can then filter on to view specific items.

 

Suppose the x-axis is the individual number of passes and the y-axis is the count. Then:

Proc Sgplot Data = Inputs;

      Vbar  = individual_ID;

Run; 

should give me that noting that the individual might say play tennis, rugby, soccer and chess then I can add a Group = sport to get a single bar for an individual with stacks on it?


There is no equal sign after the VBAR in the VBAR statement. The option GROUP= will add in the sports that the person plays. Is there some reason why you need to ask? You can just run the code and see what happens.

 

But say I want to filter on just rugby and still track the individual number in the x-axis.

 

Add this command into PROC SGPLOT.

 

where sport='Rugby';

 

Then finally, what if I want to filter on just on individual number to view more detail into them only across the various sports.


Similar solution

where individual_id=7;

Bar charts seem to be a poor choice for displaying this information. A frequency table makes more sense to me (PROC FREQ)

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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