The SAS Output Delivery System and reporting techniques

Using style formats in PROC TABULATE

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 14
Accepted Solution

Using style formats in PROC TABULATE

Is there a way to apply color format to an entire row? Specifically, I have a table and using PROC TABULATE I wish to highlight the entire "Total" row at the bottom to make it stand out. I can highlight the cell labeled "Total" but cannot figure out how to color the rows of data next to it.


Accepted Solutions
Solution
‎01-30-2018 10:07 AM
Super User
Posts: 13,909

Re: Using style formats in PROC TABULATE

This link shows a number of ways to do banding in proc tabulate: http://support.sas.com/kb/25/401.html

 

And this link shows a solution closer to what you ask: https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-Total-all-differently-in-Proc-Tabulate/...

 

You can may your table statements easier to read by using LABEL statements or KEYLABEL if the label text for you ALL will be the same(or mostly the same). Then you reduce the number ='xxxxxxxx' in the table.

View solution in original post


All Replies
Super User
Super User
Posts: 9,813

Re: Using style formats in PROC TABULATE

Occasional Contributor
Posts: 14

Re: Using style formats in PROC TABULATE

Thanks for those resources, the <Parent> feature for customizing across rows is helpful but I'm having difficulty find examples of how to employ it on the All or Total rows within my table. I understand how to do it for a variable but not how to attached it to those calculation rows. These rows don't exist in my original data table, they are the result of the PROC TABULATE. 

Super User
Posts: 13,909

Re: Using style formats in PROC TABULATE

It might help to show the code you are using as there are some interactions between column on row that my be involved.

 

style=<parent> is likely what you are looking for but where to place it depends on the code you are using.

Occasional Contributor
Posts: 14

Re: Using style formats in PROC TABULATE

Sure below is my code sample

 

PROC TABULATE FORMAT= COMMA10.0 DATA = admit_accepted;


CLASS Event_Type Event_Name Event_Date Entry_Term_2;


VAR Attended Admitted Offer_Accepted Enrolled;


TABLE Event_Type='Event Type' * ((Event_Name='Event Name' * ((Event_Date=' ' * Entry_Term_2=' ') All = {Label ='Total (ALL)' style = {background = #90D9D7 }}))All = {Label = 'Total (ALL)' style = {background = #4d7ebf}}), Attended = 'Attended Event' Admitted Offer_Accepted='Offer Accepted' Enrolled;


FORMAT Entry_Term_2 $term_order.; **Term order format just puts in numerical order by entry term


TITLE 'Prospective/Yield Event Admissions Funnel';


KEYLABEL N=' ' SUM= ' ';


run;

 

This gives me the following out put but I want the "ALL" columns to be highlighted across the rows of other variables

reportsnip.JPG

Solution
‎01-30-2018 10:07 AM
Super User
Posts: 13,909

Re: Using style formats in PROC TABULATE

This link shows a number of ways to do banding in proc tabulate: http://support.sas.com/kb/25/401.html

 

And this link shows a solution closer to what you ask: https://communities.sas.com/t5/ODS-and-Base-Reporting/Format-Total-all-differently-in-Proc-Tabulate/...

 

You can may your table statements easier to read by using LABEL statements or KEYLABEL if the label text for you ALL will be the same(or mostly the same). Then you reduce the number ='xxxxxxxx' in the table.

SAS Super FREQ
Posts: 9,424

Re: Using style formats in PROC TABULATE

In addition to the links already provided, you may want to look up, specifically, the use of the STYLE_PRECEDENCE option on the TABLE statement. By default, the COLUMN dimension's style takes precedence over the ROW dimension's style. You may need to specifically use the option to change that behavior.

cynthia
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 210 views
  • 1 like
  • 4 in conversation