BookmarkSubscribeRSS Feed
deleted_user
Not applicable
How can i add a cumulative grand total to my proc tabulate report? OR is this even possible!

Here is my code:

PROC TABULATE data=RepCore.aggregate2 ;
CLASS week date signer APPOINTMENT sale;
VAR Num ;
TABLE week * (date='' ALL='Total Week') ALL='Park Total',
Signer='Region' * (N='Total' ROWPCTN='% For Day')
APPOINTMENT*(N PCTN *F=6.1)
SALE*(N PCTN *F=6.1)
ALL='Grand Total'/ MISSTEXT='0';

RUN; Just heard this is not possible 😞 oh well back to the drawing board


Message was edited by: Jenzie
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
Proc Report will let you calculate a cumulative column inside a COMPUTE block. And, a DATA step report would let you calculate a cumulative column.

The issue with PROC TABULATE is that it really only writes one cell at a time in one row at a time, so there is no visibility of the "previous" value in a previous report row and no ability to apply your own assignment statement to a column.

But since you do have this functionality with PROC REPORT or DATA step, it's just not possible with TABULATE.

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
  • 4565 views
  • 0 likes
  • 2 in conversation