BookmarkSubscribeRSS Feed
NataljaK
Obsidian | Level 7
Below is a Summary table and code for it. Is it possible to color the columns´ content (heading and data) with different colors for different level of class variable FLAG (1 and 2) ?

FLAG
1 2
OVFL Sum 8170.90 120561.00
TOTAL Sum 10562.24 156204.00





PROC TABULATE
DATA=WORK.D03_REPORT_TABLE_AVG(FIRSTOBS=1 )

;

VAR OVFL TOTAL;
CLASS FLAG / ORDER=UNFORMATTED MISSING;
TABLE /* Row Dimension */
OVFL*
Sum
TOTAL*
Sum,
/* Column Dimension */
FLAG ;
;

RUN;
2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi:
PROC TABULATE allows the use of the CLASSLEV statement, along with style=<parent> in order to produce "banded" reports, where the calculated data cells inherit their colors from the parent header cells.

In order for this to work, you might have to move your SUM statistic into the COL dimension instead of the ROW dimension. For an example, see pages 17-20 in the PROC TABULATE section of this paper:
http://support.sas.com/resources/papers/stylesinprocs.pdf

cynthia
NataljaK
Obsidian | Level 7
Thank you for the real assistance!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1159 views
  • 0 likes
  • 2 in conversation