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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.