2 Replies Latest reply on Jun 22, 2018 9:05 AM by paul.winiecki

# Divide Data into Groups based on a Rank (need the grouping variable to be a dimension)

Hello All,

I'm currently stumped on a Tableau version 10.5 task. I need to divide customers into 3 similar sized groups based on where they stand in number of dollars spent in relation to other customers. Three quirks: only the customers with Condition=1 will be divided into the groups, no two customers with Condition=1 can have the same rank (so it is OK if two customers with dollars spent=10 are in different groups), and it's OK if the groups are not exactly the same size.

In my first attempt I ranked customers using RANK_UNIQUE and if condition=0 the customer received the rank of the last customer with Condition=1 before it. I then made a variable to divide customers into groups of Low, Medium, and High based on their rank. Since there are 10 customers with Condition=1 the groups are sized 3, 3, and 4. However, since it's a table calculation I'm not able to use the groups as a dimension. I have to be able to use the Groups as a dimension because I have to plot them as Groups using a bar chart. If anyone has any ideas on how to group the data even if you know of a completely different approach I would really appreciate it!

Thanks,

Paul

• ###### 1. Re: Divide Data into Groups based on a Rank (need the grouping variable to be a dimension)

Hi Paul

Not sure I understand what you need but see the attached

it returns this

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

1 of 1 people found this helpful
• ###### 2. Re: Divide Data into Groups based on a Rank (need the grouping variable to be a dimension)

Hi Jim,

Thanks for your help. This isn't quite what I was looking for, but I am looking for something similar. Going off your plot, I would like to only have 1 bar for each tier of "Low", "Medium", and "High". Each bar would be the sum of the dollars spent for all the customers in that tier. I'm still working on trying to figure it out, so if you have any ideas or tips I would really appreciate it. Thanks!