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

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 421 views
  • 0 likes
  • 2 in conversation