# The Rank function in Tableau & all its variants

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2021-02-05
- **Format:** Video · 19 min watch · transcript available
- **Topics:** Data visualisation, Analytics
- **Tools:** Tableau (calculated fields, filters, rank, table calculations)
- **Canonical:** https://just-tim.com/posts/the-rank-function-on-tableau-all-its-variants
- **Watch:** https://youtu.be/CClLrVaRH8M

I walk through the RANK function in Tableau and all five of its variants: RANK, RANK_DENSE, RANK_MODIFIED, RANK_PERCENTILE and RANK_UNIQUE. Using the Superstore data I set up a list of manufacturers by distinct product count, then build each ranking calculation to show exactly how they differ.

## Key takeaways

- The standard RANK function counts descending by default and inserts a gap after duplicate values, so tied items share a rank and the next number skips ahead.
- RANK_DENSE assigns identical ranks to ties but inserts no gaps, giving a continuous count down the table.
- RANK_MODIFIED also ties duplicates but places the gap before the next group, pushing the running rank ahead.
- RANK_PERCENTILE returns a 0-to-1 spread rather than a position, useful for encoding where a value sits in the data, for instance as a colour.
- You can write a rank calculation directly in a pill, then hold command/control and drag it to the Measure Values shelf to turn it into a reusable calculated field, and you don't need the bracketed [asc]/[desc] placeholders from the documentation.

## Chapters

- 0:20 Setting up the manufacturer list
- 1:26 Filtering to the top 30
- 2:30 Building the standard rank
- 5:10 How standard rank handles ties
- 6:21 Changing ascending and descending
- 8:05 Rank dense explained
- 10:49 Rank modified explained
- 13:18 Rank percentile explained
- 15:24 Rank unique and a quick tip
- 17:45 Why table calculations matter next

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/the-rank-function-on-tableau-all-its-variants

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
