2 Replies Latest reply on Jul 25, 2013 9:54 AM by Matt Lutton

# Ranking - Showing only single rank value???

Hi everyone,

I am pretty new to Tableau, and my inability to do this is driving me NUTS!  I would very much appreciate any help I can get.

My data is somewhat sensitive, so I will make up a similar problem to my own and pose that question.  Let's say I have a bunch of car models and a bunch of prices.  I have 2 worksheets, the first showing all of the car models sorted by price, and the second showing just 1 car model that I am specifically interested in (let's say I was building a dashboard for Honda, and I filtered on the Accord, so I would want just the Accord to show up in this second worksheet as a little bar).  In that single bar for the Accord, I want to see (1) the price and (2) the ranking of price when compared to all the other models from different companies in my other worksheet.

My problem is, when I use index(), if I sort on Accord only in the worksheet, I am always going to see a ranking of 1.  If it was the 10th most expensive car, how can I get it to show the number 10?

Any help would be GREATLY appreciated.

Thanks!

Andy

• ###### 1. Re: Ranking - Showing only single rank value???

Hi Andy,

The INDEX() function is an example of what's called a table calculation in Tableau. The key to all table calculations is to set up the addressing and partitioning correctly, which can be confusing, especially without an example. Could you please mock up the data you are describing and post a packaged workbook?

For future reference, here's Shawn's trust Why Your Question Didn't Get Answered document. As Shawn mentions, the more setup work you do up front, the more likely the forum-answerers will be to help you!

• ###### 2. Re: Ranking - Showing only single rank value???

This is actually fairly simple to do--see "Number 1-Filter without affecting results" in Jonathan Drummey's workbook here:

1. Filter Without Affecting Results

Basically, you just create a calculation like:

lookup(min([FieldName]),0)

And put it on the filter shelf for any views you want to do this for.  After that, the result of the INDEX() should return the results you want.