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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.