Desktop productivity for business analysts and programmers

Filter by the inverse of the Rank

Reply
Contributor
Posts: 51

Filter by the inverse of the Rank

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

Contributor
Posts: 45

Re: Filter by the inverse of the Rank

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

Contributor
Posts: 51

Re: Filter by the inverse of the Rank

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!

Contributor
Posts: 45

Re: Filter by the inverse of the Rank

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)

Ask a Question
Discussion stats
  • 3 replies
  • 135 views
  • 0 likes
  • 2 in conversation