BookmarkSubscribeRSS Feed
DLROW
Quartz | Level 8

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;

 

DLROW_0-1601520488890.png

 

3 REPLIES 3
Reeza
Super User

You can try a COMPUTE block like this one:

https://stackoverflow.com/questions/14389941/sas-conditional-row-highlighting-with-ods-and-proc-prin...

 

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;

 

DLROW_0-1601520488890.png

 


 

Cynthia_sas
SAS Super FREQ
Hi:
In addition to @Reeza's suggestions, this paper goes into more detail:
https://support.sas.com/resources/papers/proceedings14/SAS388-2014.pdf about working with ACROSS items.
Cynthia
DLROW
Quartz | Level 8

Thanks all. I went through those papers and I got what I need. 

 

 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 981 views
  • 3 likes
  • 3 in conversation