BookmarkSubscribeRSS Feed
paulrockliffe
Obsidian | Level 7

I've got a filter setup that takes a parameter value and filters on a rank to include everything less than or equal to the parameter value.  What I'm doing is letting the user decide how many results they want to see, eg a Top 10 list.  This works perfectly, but for some of my rankings I'm interested in both the Top 10 rankings and the bottom 10 rankings, the top rankings represent increases, the bottom 10 represent decreases.

 

The top 10 is relatively easy as it's always going to be rankings 1 to 10, but the bottom 10 will always be MAX(Ranking) to MAX(Ranking)-10, I don't know how to modify my filter to reflect that.  Does anyone have any ideas?  I'm working in EG5.1

 

I can go back to the step where I'm adding my rankings and add another computed column for the inverse rankings, but I'd rather avoid this if possible as it means adding another 15 columns of data to an already large dataset and the information is already in the dataset.

 

Thanks

3 REPLIES 3
Jay_TxOAG
Quartz | Level 8

You could pull the SAS code from the task that generates the top records...then add a program task to do the same but for the bottom records.

If you are not a SAS programmer, you could post that code and someone could help you re-arrange it to get your results

paulrockliffe
Obsidian | Level 7

Hello I tried that, but couldn't find the code anywhere, it's not accessible in the Rank Task like it is from Query Builder.  Any pointers wold be appreciated as it would be useful to be able to get the code from these data tasks in future.

 

I did get around my specific issue by duplicating all my ranking tasks and ticking the box that reverses the result, but it's not very elegant!

Jay_TxOAG
Quartz | Level 8

Glad you got a solution. The code is inside the task, bottom left (Preview code button).

 

Post what you have and explain how you wish to change it. (I used 6.1 but it is also in 5.1)

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 843 views
  • 0 likes
  • 2 in conversation