BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
spcoman
Fluorite | Level 6

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.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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

6 REPLIES 6
spcoman
Fluorite | Level 6

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. 

ballardw
Super User

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.

spcoman
Fluorite | Level 6

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

ballardw
Super User

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.

Cynthia_sas
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 6 replies
  • 1230 views
  • 1 like
  • 4 in conversation