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
Diamond | Level 26
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 5382 views
  • 1 like
  • 2 in conversation