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

Is there a way to remove only the repeating sub headings [red arrow] - (while still keeping the first heading [blue arrow])

 

Tabulate row heading.png

Sample code to produce the output above

proc tabulate data=sashelp.class;
class age name;
var Weight;

table age*(name all='all name'*[style=[background=lightblue]]) all='all age', Weight;
run;

To get something like this with only a top header and no header for each subtotal.

 

GertNissen_0-1588775177325.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  The best you can do with TABULATE is to move the row headers (Age/Name) up into the Box on the left side of the top of the table.

Cynthia_sas_1-1588777078572.png

 

  You might like the look and feel of PROC REPORT better:

Cynthia_sas_0-1588777047172.png

 

  Here's the code for PROC REPORT vs the BOX approach with TABULATE:

proc tabulate data=sashelp.class;
class age name;
var Weight;
table age=' '*(name=' ' all='all name'*[style=[background=lightblue]]) all='all age', 
      Weight / box='Age and Name';
run;

proc report data=sashelp.class
  style(summary)=Header;
  column age name weight;
  define age / order style(column)=Header;
  define name / order style(column)=Header;
  define weight / sum;
  break after age/summarize;
  compute after age;
    name='Name Tot';
	line ' ';
  endcomp;
run;

Cynthia

 

View solution in original post

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:

  The best you can do with TABULATE is to move the row headers (Age/Name) up into the Box on the left side of the top of the table.

Cynthia_sas_1-1588777078572.png

 

  You might like the look and feel of PROC REPORT better:

Cynthia_sas_0-1588777047172.png

 

  Here's the code for PROC REPORT vs the BOX approach with TABULATE:

proc tabulate data=sashelp.class;
class age name;
var Weight;
table age=' '*(name=' ' all='all name'*[style=[background=lightblue]]) all='all age', 
      Weight / box='Age and Name';
run;

proc report data=sashelp.class
  style(summary)=Header;
  column age name weight;
  define age / order style(column)=Header;
  define name / order style(column)=Header;
  define weight / sum;
  break after age/summarize;
  compute after age;
    name='Name Tot';
	line ' ';
  endcomp;
run;

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
  • 1 reply
  • 962 views
  • 1 like
  • 2 in conversation