The RANK function in Tableau is a calculation function that assigns a rank or position to each row or record in a result set based on the values in one or more fields. It is commonly used to determine the relative position of each record within a specified order, such as ranking sales figures, scores, or performance metrics.
The RANK function in Tableau can be used in two main variations:
Rank (dense): This assigns a unique rank to each record, and if multiple records have the same values, they receive the same rank. The next rank is then incremented by one. For example, if two records have the same highest sales value, both would be assigned a rank of 1, and the next record would be ranked as 2.
Rank (unique): This assigns a unique rank to each record, but if multiple records have the same values, they do not receive the same rank. Instead, they skip ranks. For example, if two records have the same highest sales value, one would be ranked as 1, and the next record would be ranked as 2.
The RANK function is often used in conjunction with other functions and calculations to create various types of ranking and leaderboard visualizations in Tableau, allowing users to quickly identify the top performers or outliers in a dataset.