BookmarkSubscribeRSS Feed
rashmirashid
Calcite | Level 5

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

 

Capture.JPG

 

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?

1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
I see that you're using STYLE=PARENT, but without data to use, in order to run your code, anyone who might be interested has to make some fake data that may or may not be in the structure that is the same as your structure.

If you can't share your data, then help us to help you by making some fake data or using SASHELP data to mock up an example.

Cynthia

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 1 reply
  • 1040 views
  • 0 likes
  • 2 in conversation