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

Is there a way to use the tabulate procedure to calculate a value other than one of the default statistics? I would like to calculate the change from the base year.  Ideally I would like to calculate some values after the all line.

One way to do this is to create a second table and prefill the second table with summary data from the data layer, however the solution is not a clean as calculating inside of SAS.

I would like to create something like this.

Year123
Total434744704481
% Growth Over Prior Year2.80%0.20%
Cumulative Growth Since base year2.80%3.10%
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Not currently a feature in Proc Tabulate.

I often pre-summarize data and use tabulate to display the values but depending on what you are doing that approach might be more work than Proc Report.

View solution in original post

4 REPLIES 4
jakarman
Barite | Level 11

proc report?  Base SAS(R) 9.4 Procedures Guide, Third Edition is his a compute block

---->-- ja karman --<-----
DavidPhillips2
Rhodochrosite | Level 12

I would strongly prefer to stay with tabulate.

ballardw
Super User

Not currently a feature in Proc Tabulate.

I often pre-summarize data and use tabulate to display the values but depending on what you are doing that approach might be more work than Proc Report.

Cynthia_sas
SAS Super FREQ

Hi:

  TABULATE does not allow you to compute your own (extra) summary lines at the bottom of the report. ALL is what produces the summary line that you show as TOTAL and the other 2 lines would not normally be possible with TABULATE unless you faked out the data and made your own "extra" observations. PROC REPORT is more flexible and more powerful in allowing you to customize and add extra break lines to the report. As Jaap explained, it is the perfect job for a COMPUTE block.

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