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

proc tabulate data=CA_NON_REFER  ORDER=FREQ;

class application_month CHECKLIST_FAIL;

table CHECKLIST_FAIL * (N COLPCTN) , application_month  ;

run;

Hi,

This is a cross tabulation simplified version of my code; of the number of application coming in each month, what is the top checklists that fail.

Application Month on the Y-axis, Checklist on the X-axis.

I use ORDER=FREQ to sort by frequency, and it is working on the y-axis checklists. But I don't want the x-axis application month to be sorted by frequency.

Besides workarounds, is there a build-in function in proc-tabulate for sorting frequency only for rows?


proctabulate_orderfreq.png
1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

Remove the ORDER= option from the PROC statement and move it to the CLASS statement to which it applies.

proc tabulate data=sashelp.class;

   class sex;

   class age / order=freq;

   tables age,sex;

   run;

View solution in original post

3 REPLIES 3
Ksharp
Super User

Could you make a format then using this format to customize the order.

class ../preloadfmt order=formate/data?

Ksharp

data_null__
Jade | Level 19

Remove the ORDER= option from the PROC statement and move it to the CLASS statement to which it applies.

proc tabulate data=sashelp.class;

   class sex;

   class age / order=freq;

   tables age,sex;

   run;

hellind
Quartz | Level 8

Thank you both for helping.

proc tabulate data=CA_NON_REFER ;
class application_month;

class CHECKLIST_FAIL /ORDER=FREQ;
table CHECKLIST_FAIL * (N COLPCTN) , application_month  ;
run;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

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.

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
  • 3 replies
  • 8168 views
  • 3 likes
  • 3 in conversation