11-08-2013 02:10 PM
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.
11-08-2013 04:04 PM
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).
11-09-2013 03:11 AM
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.
11-09-2013 01:33 AM
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', .....
11-11-2013 03:16 PM
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.