I'm trying to build a Summary Table using PROC TABULATE, but I would like to order the table not by the class variable, but the measure.
Enterprise Guide got me started with the following code, but I'm struggling to find out how I can sort the table by the variable SUM_of_Saldo (rather than the SSB_Navn)
PROC TABULATE
DATA=WORK.QUERY_FOR_BSU_RK_TIMESNAP_0009
FORMAT=commax32.;
VAR SUM_of_Saldo ;
CLASS Periode / ORDER=UNFORMATTED MISSING;
CLASS SSB_Navn / ORDER=UNFORMATTED MISSING;
TABLE
/* ROW Statement */
SSB_Navn
all = 'Total' ,
/* COLUMN Statement */
Periode *(SUM_of_Saldo * Sum={LABEL="Sum"} )
all = 'Total' *(SUM_of_Saldo * Sum={LABEL="Sum"} ) ;
;
RUN;
Thanks for any pointers 🙂
Hi:
This is a similar post and the answer is the same. It is easier to do what you want with PROC REPORT than with PROC TABULATE. The screenshot attached to this posting shows the type of code to use with PROC REPORT.
http://communities.sas.com/message/100730/#100730
The bottom line is that neither TABULATE nor REPORT will allow you to order on the equivalent of a statistic or calculated analysis variable. But if you create an ordering variable, then you can force PROC REPORT to show the data using the calculated amount (as shown in the screen shot where value C with a total of 15 is listed first).
cynthia
Hi:
This is a similar post and the answer is the same. It is easier to do what you want with PROC REPORT than with PROC TABULATE. The screenshot attached to this posting shows the type of code to use with PROC REPORT.
http://communities.sas.com/message/100730/#100730
The bottom line is that neither TABULATE nor REPORT will allow you to order on the equivalent of a statistic or calculated analysis variable. But if you create an ordering variable, then you can force PROC REPORT to show the data using the calculated amount (as shown in the screen shot where value C with a total of 15 is listed first).
cynthia
Thanks Cynthia
I know I should probably spend some more time getting to grips with the code, but I seem to always manage somehow using Enterprise Guide...
Seems EG does not have a built in task for PROC REPORT, so just need to get my old coding fingers dirty 😉
Thanks for your help.
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.