Maxine Bisong
Maxine Bisong

Reputation: 17

Tableau Ranking By Category

I am doing an analysis in Tableau using their Super Store data set. I need to create a new column called average sale for each category eg. Avg Furniture, Office Supplies, and Technolgy after that I need another column showing the rank of each category. eg Rank 1. Furniture, 2. Office Supplies and 3. Technology.

How can I achieve this?

Upvotes: 1

Views: 2538

Answers (1)

There is a function that you can use in your calculated field called... rank - https://onlinehelp.tableau.com/current/pro/desktop/en-us/calculations_tablecalculations_definebasic_runningtotal.html#Rank

There are a few options for rank that you can use, like RANK_UNIQUE, which assigns the same ranking value for the categorical variables that have the same label name. For example, if you had rows where 2 categories were the same, like "Office Supplies" appeared twice, then with RANK_UNIQUE if you were ranking on the sales function, then you'd get a 2 or 3 (or whatever the rank is) appear for both rows

In your context you can likely get away with the standard RANK function:

RANK(AVG([Sales]))

Let me know if you need anymore assistance

Upvotes: 1

Related Questions