3 Replies Latest reply on Jan 5, 2018 10:31 AM by Yuriy Fal

# Index and Ranking in 1 chart

I'm trying to rank in a window but it's not working the way I want it to. I filtered to top 25 distributors using Index and I'm ranking off of different criteria (the % in the screenshot below)

In my table when I use the rank function, it's ranking within my whole list and not within that window. Below are some screenshots. I also tried "commute using" and it didn't work. Sorry i don't know how to attach the workbook without all the data behind it. Please help! Can we set up a meeting if you can help?

• ###### 1. Re: Index and Ranking in 1 chart

Hi Tony,

Both INDEX() and RANK() are Table Calculations,

they're computed at the same (later) stage in the pipeline.

So a Table Calc Filter can not be applied before any other Table Calc.

Please refer to the Order of Operations page in Tableau Help:

https://onlinehelp.tableau.com/current/pro/desktop/en-us/help.html#order_of_operations.html

In your particular case it is better to use

the Top N Filter on [SAP - Distributer] dimension

using the SUM( [Total Contract...] ) as the criterion.

Then you could omit INDEX() Filter and use RANK()

on the N (remaining) Marks on a view.

Yours,

Yuri

1 of 1 people found this helpful
• ###### 2. Re: Index and Ranking in 1 chart

Thanks! I did try that route after I posted this post. But the Top N filter is not fully working correctly. I did the top 25 and only top 20 worked but the rest didn't work. How can I fix this? The top picture is the Top N filter and bottom screenshot is without the filter.

• ###### 3. Re: Index and Ranking in 1 chart

Hi Tony,

Top N Dimension Filter is calculated

just after the Context Filter(s) applied.

So any other regular Dimension filters

do not restrict the scope of Top N calc.

To make them restricting the scope,

they should be applied before the Top N Filter.

So the answer is -- put them in Context.

Yours,

Yuri