BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
raja777pharma
Fluorite | Level 6

Hi , 

 

My code is generating the waterfall 

 

data adtr_2;
  set adtr;
  postion+1;
run;

ods listing close;
ods graphics/reset = all imagename="14_2_9_1_waterfall" width=10.0in height=7.0in;
proc sgplot data=adtr_2;
  refline 50/ axis = y 
              labelloc = outside 
              labelpos = auto 
              lineattrs=(pattern=shortdash color=black)
			  label = "50 % Reduction from Baseline";
  refline -50/ axis = y 
              labelloc = outside 
              labelpos = auto 
              lineattrs=(pattern=shortdash color=black)
			  label = "-50 % Reduction from Baseline";


vbar subjid/response = pchg ;

xaxis label = "Patient Number" fitpolicy = ROTATE;
yaxis label = "Maximum Percent Reduction from Baseline in SPD" min=-100 max=100 values=(-100 to 100 by 20);

run;

 

raja777pharma_0-1749009719678.png

 

I want the Bars order by PCHG value rather than SUBJID  and display the SUBJID as labels for bars.

 

When i use the POSTION var ,below output one is coming , but i want the SUBJID display instead of POSTION values in x axis labels 

 

vbar postion/response = pchg ;

raja777pharma_1-1749009919502.png

 

my data :

raja777pharma_2-1749010093154.png

 

 

 

Thank you,

Raja.

 

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

What you want is the following:

 

vbar subjid/response = pchg categoryorder=respdesc;

This will put the bars in descending response order. 

View solution in original post

1 REPLY 1
DanH_sas
SAS Super FREQ

What you want is the following:

 

vbar subjid/response = pchg categoryorder=respdesc;

This will put the bars in descending response order. 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 777 views
  • 2 likes
  • 2 in conversation