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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.