BookmarkSubscribeRSS Feed
acairns
Fluorite | Level 6

I would like to make the data columns gray for all rows with 'Total' in the subdiv field.  I am able to change the 'Total' cell, but need the entire row to be gray.  Any suggestions?  I've searched here but haven't found anything that works.  Thank you!!!!

 

Sample.PNG

 

proc format;
value $subb 'Total'='gray';
value $subf 'Total'='white';
run;

title;


title1 "Sales Incentive and Rate Promotion Report";
title2 "&month &year";
footnote;
footnote1 j=center "Central Information Group (CIG) -- MRIT #163";
footnote2 j=center "Confidential";
footnote3 j=center "Posted to: COE Reporting Site -- Last Updated: &today";

proc tabulate
data=totals_2(firstobs=1)
out=report_sum_table(label="") format=comma20.2;
var jan feb mar apr may jun jul aug sep oct nov dec ytd_region_total;
class marketareaname / order=data missing;
class report_order / order=formatted missing ;
class subdiv / order=formatted missing;
classlev subdiv / style={background=$subb. foreground=$subf.};
class group / style={foreground=white background=gray} order=data missing;
class region1 / order=data missing;
table /* Page Dimension */
marketareaname={label=" "},
/* Row Dimension */
group={label=" "} *
subdiv={label=" "} *
region1={label=" "},
/* Column Dimension */
jan* sum={label=""}
feb* sum={label=""}
mar* sum={label=""}
apr* sum={label=""}
may* sum={label=""}
jun* sum={label=""}
jul* sum={label=""}
aug* sum={label=""}
sep* sum={label=""}
oct* sum={label=""}
nov* sum={label=""}
dec* sum={label=""}
ytd_region_total* sum={label=""}
/*Table Options */
/ box={label=_page_} indent=0;;
run;run;quit;
title; footnote;

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:

  You could do this easily in PROC REPORT, either with STYLE(SUMMARY) override or with a CALL DEFINE. But with TABULATE, you'd have to investigate the use of <PARENT> in a style override, as shown here:  http://support.sas.com/kb/25/401.html -- except in your case, you'd limit the parent inheritance only to the TOTAL lines.

 

  But, without data to test on, nobody can run your code. And, it's hard to make fake data without understanding what YOUR data looks like.

 

Cynthia

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!

What is Bayesian Analysis?

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.

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
  • 1 reply
  • 1038 views
  • 0 likes
  • 2 in conversation