Hi all
I am having the following code:
And my report shows up like this:
My requirement is that I need to print subtotals for YRMNTH field in this same report.
So ideally my report should be something like this:
How do I achieve this with PROC TABULATE? Any help would be greatly appreciated.
Thanks!
I don't believe you could do exactly that with PROC TABULATE. You would use PROC REPORT for that.
You could do something sort-of like that using ALL, making YRMNTH into a page expression, if that is acceptable.
tables all yrmnth, all .......;
where ..... is all of the rest of your table statement.
so the first ALL now is for the entire report, you'll get one page for that, and one page for each YRMNTH value, with a subtotal on it (put ALL wherever you want that subtotal).
Deepsiv,
In the days before ODS I post processed tabulate output to provide shading in totals and subtotals so I expect what you seek is possible, but surely you don't want to down the post-processing route?.
As snoopy369 has already suggested PROC REPORT has a natural way of achieving what you request. Have you had a look in the ODS Reporting Community? I expect you'll find examples there.
peterC
If you would provide a data step creating sample data and then a proc tabulate using this sample data there would be a very good chance that someone actually would post working and tested code doing what you ask for....
I believe you could get to something close to what you ask for by modifying your code as follows:
TABLE YRMNTH* (TYPE*CENTER*NAME*CODE ALL='TOTAL YRMNTH') ALL='TOTAL', .....
Hi all
Thanks for your suggestions. If I use PROC REPORT, I m unable to print the row total for the amount across newcode. I need to compute the row total for the NEWCODE variable as well. Please refer my below code:
The report appears like this: Sub total objective gets satisfied, but row total goes missing.
Could someone help me with the computation for the row total of the across field? Thanks.
I think you'll find your answer invthe ODS and Base Reporting Community
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.
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.