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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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