I am trying to create Excel reports with ODS tagsests and Proc Tabulate.
The following is my sas code for proc tabulate .
ods tagsets.excelxp style=minimal file="/groupspace/egvcar/rashmi/llbean/saspgms/cdi_llb_monthly_dashboard/inactive.xls";
options missing=' ' nocenter ;
/************************ Inactive Cards ********************/
ods tagsets.excelxp options(sheet_name='Inactive Cards' frozen_rowheaders="1" embedded_titles='yes'
embedded_footnotes='yes' autofit_height='yes'
merge_titles_footnotes='Yes');
options missing=' ' nocenter;
title bold height=11pt "Inactive Cards Report ";
footnote1 "Note: ";
footnote2 "This Report is based on Calendar Year";
proc format;
value actgrp_i
0='Never Active '
1='Last Active 0-1 Mos '
3='Last Active 2-3 Mos '
6='Last Active 4-6 Mos '
12='Last Active 7-12 Mos '
18='Last Active 13-18 Mos'
23='Last Active 19-23 Mos'
24='Last Active 24+ Mos '
99='Total '
;
value watchit
99='#ebf1de'
;
run;
proc tabulate data=llbdash.inactiveall ;
class type active_grp tr_month calendar_label;
classlev calendar_label tr_month / style=[font_weight=bold foreground=white background=#0c5641];
classlev active_grp /style=[background=watchit. cellwidth=100];
var otb open_accounts avg_otb/style=<parent>;
table type=' '*
active_grp=' '*
( OTB*f=dollar20.
OPEN_ACCOUNTS*f=comma12.
AVG_OTB*f=dollar20.
)*sum=' '*[style=<parent>],
calendar_label=' '*
tr_month=' '/ row=float Box=[style=[
font_weight=bold foreground=white background=#0c5641 ]] box=' ';
run;
ods tagsets.excelxp close;
The above code gives the following output
How do I display the row values corresponding to Total in the same color?
I used Style_precedence=row options as well which doesn't seem to work for me?
Any suggestions?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.