BookmarkSubscribeRSS Feed
ChuckB
Calcite | Level 5
Hi,

Using WRS 4.2. We have a set of analysis tables that summarize metrics by bond credit rating (AAA, AA+, AA, AA- ...) and we have table and graph reports based off this. Currently it sorts alphanumerically(not what we need in this case) or I can use the rank functionality to sort by the measure.

Question -- what is the best way to apply a custom sort order to these graphs? Is there a section in the WRS 4.2 user guide that addresses this? If so I haven't been successful in finding it.

Thanks,
Chuck
3 REPLIES 3
julierd
SAS Employee
Hi Chuck,

The following SAS Note might be helpful to you:
http://tsdsrv05.unx.sas.com:7777/iw/docs/sasnotes/fusion/33/017.html

I hope that works for you.

Julie
NicolaD
Calcite | Level 5
Hi
Unfortunately I can't open the link posted by Julierd at work (access is denied as deemed none business related!) so I don't know if her asnwer is the same as mine.

We use custom sorting for some of our metrics by adding leading spaces to the variable names, I do this in Enterprise Guide but I'm sure you could do it in Information Map Studio too.

For instance we have a variable - client type which can be Learning disability, Mental health, Other vulnerable people, Physical disability and Substance misuse

and we want them in the following order:

Physical disability
Mental health
Learning disability
Substance misuse
Other vulnerable people

I use the following data step in EG:

data ordered_data;
set raw_data;
if trim(Category1) = 'Substance misuse' then Category1 = '_Substance misuse';
if trim(Category1) = 'Learning disability' then Category1 = '_ _Learning disability';
if trim(Category1) = 'Mental health' then Category1 = '_ _ _Mental health';
if trim(Category1) = 'Physical disability' then Category1 = '_ _ _ _Physical disability';
if trim(Category1) = 'Other vulnerable people' then Category1 = 'Other vulnerable people';
run;

I've used dashes here in place of spaces as the text editor for this forum appears to reduce multiple spaces to one space!

so Physical disability has 4 leading spaces, Mental health has 3 leading spaces, Learning disabilty 2 and so on. WRS counts spaces first before alphanumeric ordering, but cleverly doesn't display them on the charts. If you are able to manipulate your variable names I'm sure this would work for you.

Nicola
Madelyn_SAS
SAS Super FREQ
Here is the external link to the referenced sample

http://support.sas.com/kb/33/017.html

sas-innovate-2024.png

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.

 

Register now!

How to Concatenate Values

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.

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
  • 822 views
  • 0 likes
  • 4 in conversation