Hi - I need to highlight a variance (cell) that is >=15% or <=-15%. Below is the sample and code. Please help. Thanks.
ODS EXCEL;
PROC REPORT Data=DATA1
COLUMNS First Group Second Group Date_MMYYYY, TOTAL_COUNT Date_MMYYYY,VARIANCE;
define FIRST GROUP / group 'First group' ORDER = INTERNAL;
define SECOND GROUP / group 'Second Group' ORDER = INTERNAL;
define DATE_MMYY / across '';
define TOTAL_COUNT / analysis '' format=comma20.;
define VARIANCE / analysis '' format=percent8.2;
Run;
title;
ods excel close;
You can try a COMPUTE block like this one:
Or you can try custom formats, this paper does a great job explaining all the different implementation options.
https://www.lexjansen.com/wuss/2006/tutorials/TUT-Carpenter.pdf
@DLROW wrote:
Hi - I need to highlight a variance (cell) that is >=15% or <=-15%. Below is the sample and code. Please help. Thanks.
ODS EXCEL;
PROC REPORT Data=DATA1
COLUMNS First Group Second Group Date_MMYYYY, TOTAL_COUNT Date_MMYYYY,VARIANCE;
define FIRST GROUP / group 'First group' ORDER = INTERNAL;
define SECOND GROUP / group 'Second Group' ORDER = INTERNAL;
define DATE_MMYY / across '';
define TOTAL_COUNT / analysis '' format=comma20.;
define VARIANCE / analysis '' format=percent8.2;Run;
title;ods excel close;
Thanks all. I went through those papers and I got what I need.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.