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.
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.
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.