BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sebster24
Quartz | Level 8

Hello, I am currently presenting some results in proc report and intend to apply some conditional formatting to a summarize result. 

I am using proc report for its ease in exporting the figures to latex. 

I have written below the following code::



proc report data= SASHELP.SHOES
style(header)=[color=black  fontfamily=helvetica fontsize=1 background=yellow fontweight=bold];
column region Stores;
define region / "region" display style(column)=[width=2cm] group;
define stores/"stores" display style(column)=[width=3.5cm] mean; 
rbreak after/ summarize style=Header;
compute after;
region="Mean";
endcomp;

compute stores;
if _break_="_RBREAK_" then do;
	if stores >= 5 then call define('stores.mean','style','style={backgroundcolor=green}');
	else if stores < 5 then call define('stores.mean','style','style={backgroundcolor=yellow}');
	else if stores < 2 then call define('stores.mean','style','style={backgroundcolor=red}');
end;
endcomp;
run;

My issue is the output (mean) of stores (mean=11.648) should have a background colour "green", given the "if" condition. I am unable to figure out why it is "Yellow".

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
JosvanderVelden
SAS Super FREQ
If you have not found the error yourself yet use:
if stores.mean ...
else if stores.mean ...
else if stores.mean ...

View solution in original post

1 REPLY 1
JosvanderVelden
SAS Super FREQ
If you have not found the error yourself yet use:
if stores.mean ...
else if stores.mean ...
else if stores.mean ...

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!

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