BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

Would like to know how to do this in Proc Report.
How to only display Grand Totals of certain columns and to hide some of those Grand Totals that are not needed?

Thanks a Ton!
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
A search of the SAS support website http://support.sas.com/ using either the website's SEARCH facility or using the Google advanced search argument below yielded matching DOC and technical paper (user community, SUGI, SGF) documents on this topic.

Google advanced search argument (site parameter must be in lowercase):
proc report grand totals site:sas.com


Scott Barry
SBBWorks, Inc.
venkatesh
Calcite | Level 5
Hi Lee.,

data grocery;
input Sector $ Manager $ Department $ Sales @@;
datalines;
se 1 np1 50 se 1 p1 100 se 1 np2 120 se 1 p2 80
se 2 np1 40 se 2 p1 300 se 2 np2 220 se 2 p2 70
nw 3 np1 60 nw 3 p1 600 nw 3 np2 420 nw 3 p2 30
nw 4 np1 45 nw 4 p1 250 nw 4 np2 230 nw 4 p2 73
nw 9 np1 45 nw 9 p1 205 nw 9 np2 420 nw 9 p2 76
sw 5 np1 53 sw 5 p1 130 sw 5 np2 120 sw 5 p2 50
sw 6 np1 40 sw 6 p1 350 sw 6 np2 225 sw 6 p2 80
ne 7 np1 90 ne 7 p1 190 ne 7 np2 420 ne 7 p2 86
ne 8 np1 200 ne 8 p1 300 ne 8 np2 420 ne 8 p2 125
;
proc report data=grocery nowd;
column manager department sales;
define manager / order width=8 'Sales Manager';
define sales / analysis sum format=dollar7.2 'Sales';
/* break after manager / dol summarize suppress skip; */
rbreak after /dol summarize;
run;

Thanks.....
Cynthia_sas
SAS Super FREQ
Hi:
Here are some other samples, which use SASHELP.SHOES and may or may not be what you want to do. One example "hides" totals for 2 columns and the other example uses NOPRINT and the hiding technique. Note that if missing is not set to display as space, then you will see '.' in the grand total line.

cynthia
[pre]

options missing = ' ';
proc report data=sashelp.shoes nowd;
title 'Blank Out Total for Inventory and Returns';
column region sales inventory returns both;
define region / group;
define sales / sum 'Sales';
define inventory / sum;
define returns / sum;
define both / computed 'Inventory minus Returns' f=dollar14.;
rbreak after / summarize;
compute both;
both = inventory.sum - returns.sum ;
endcomp;
compute after;
region = 'Grand Total';
inventory.sum = .;
returns.sum = .;
endcomp;
run;

options missing = ' ';
proc report data=sashelp.shoes nowd;
title 'Hide Inventory Column, but Use It';
column region sales inventory returns both;
define region / group;
define sales / sum 'Sales';
define inventory / sum noprint;
define returns / sum;
define both / computed 'Inventory minus Returns' f=dollar14.;
rbreak after / summarize;
compute both;
both = inventory.sum - returns.sum ;
endcomp;
compute after;
region = 'Grand Total';
inventory.sum = .;
returns.sum = .;
endcomp;
run;

[/pre]

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 790 views
  • 0 likes
  • 4 in conversation