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!!!!
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;
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
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.