Hi,
I would like to put my output from my summary table in a specific order.
I created the summary and then output the results to a work file, so I can reorder it. Now it is ordering in alpabetical order.
One way I thought of is to create a calculated value based on the row, and then another calculated value with a case to assign my row number to sort--
Anyone have a function for row? Monotonic() returns odd results when I try to add to it!
In the example attached, I would like Category 3 to be moved to the bottom of the report after Category 2.
Any ideas? Thanks in advance.
Jo
I heeded the warning about monotonic!
I tried going into the code and changing the order statements in the PROC Tabulate.
But what ultimately worked was simply padding the category that I wanted first with 3 blanks, next category 2 blanks, etc.
Worked!
Be careful about using monotonic, or trying to do this in SQL. SQL is an inherently set-oriented language, and doesn't do "do this line before this line" types of operations well.
In your case, it looks to me like you could assign numeric values for your categories in whatever order you want, and then use formats to create the nicely labelled output.
Tom
I heeded the warning about monotonic!
I tried going into the code and changing the order statements in the PROC Tabulate.
But what ultimately worked was simply padding the category that I wanted first with 3 blanks, next category 2 blanks, etc.
Worked!
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.