3 Replies Latest reply on Sep 17, 2018 12:01 PM by Matt Hladun

# Return Value Based on Ranking

This one has exceeded my Tableau abilities...

I have a list of scores in different subjects. I've been asked to identify the score that is at the bottom of the top 80% of the scores for that subject.

So, for example, let's say there were 50 scores in a subject. I need to rank them from highest to lowest, identify the top 80% of the scores (which, in this example would be 40 scores) and then return the value of the last score in that top 80% (which would be the score ranked #40).

Can this be accomplished in Tableau? I'm able to get the number of scores that represent the 80% of a given list but haven't figured out a way to return the value of that last score in the 80% list.

Thanks!

• ###### 1. Re: Return Value Based on Ranking

Something Like This

INDEX()=40

Drag to Filter and Set TRUE

• ###### 2. Re: Return Value Based on Ranking

To expand on what Deepak suggested, if you want to have the whole list still display on the sheet, but identify that 80th guy on the list,

WINDOW_SUM( if INDEX() = [your calc where you identify the 80th percent guy] then SUM([score]) END )

If your score is already an aggregate calc, then you don't want to so SUM().  Just do [Score] in that calc.

1 of 1 people found this helpful
• ###### 3. Re: Return Value Based on Ranking

Thanks Joe and Deepak! Your help got me the info I was looking for.