2 Replies Latest reply on Oct 12, 2018 5:14 AM by Satish Ramakrishna

# How to create quartile and quantile buckets

Hello, community.

I have a simple problem which is not very simple to achieve in Tableau. I have student scores data. I want to show the count of students (COUNTD of StudentID) in each quartile or quantile bucket of student score. How to achieve this?

For example: consider I have 100 students whose scores range from 0 to 50. I want to show a stacked bar chart which shows the number of students in each quartile (Q1,Q2, Q3,Q4) or quantile(Q1,Q2, Q3,Q4, Q5) like below image.

Note - The value should be able to aggregate at different levels like Grade, subject, school etc.. like below

I cannot attach any workbook. Sorry about that.

• ###### 1. Re: How to create quartile and quantile buckets

good morning -

on the surface this looks like a simple problem but the solution is actually quite involved - see the attached solution to dividing customers into quintiles based on sales - i.e. counting the number of customers that make up 20% of sales etc.

If you happen to be going to TC18 in New Orleans sign up for a Braindate on the 80/20 Rule - I will be explaining the process in detail

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.

• ###### 2. Re: How to create quartile and quantile buckets

Thanks for the reply, Jim. Your solution shows the number of customers who make 20% of sales and so on. I was more looking for percentile buckets. I will still mark your answer as correct as it solves my question.

I followed the below link to solve my percentile problem. So if anyone is looking for the same can go through it.