KNOWLEDGE BASE

## How to group by Rank Percentile without using Table Calculation

Published: 05 Feb 2023

### Question

How to group by Rank Percentile without using Table Calculation.

<IMAGE>

### Environment

• Tableau Desktop

This procedure shows five groupings by percentile.
ex) Group A : 1.0 ~ 0.8
Group B : 0.8 ~ 0.6
Group C : 0.6 ~ 0.4
Group D : 0.4 ~ 0.2
Group E : 0.2 ~ 0.0

<Procedure>
1. Connect to Sample Superstore.
2. Drag [State/Province] to Rows and [Sales] to Text on Marks.
3. Create a new calculated field as following.
Name : Percentile_0.2
Calculation : {FIXED :Percentile({FIXED [State/Province]:SUM([Sales])},0.2)}
4. Create a new calculated field as following.
Name : Percentile_0.4
Calculation : {FIXED :Percentile({FIXED [State/Province]:SUM([Sales])},0.4)}
5. Create a new calculated field as following.
Name : Percentile_0.6
Calculation : {FIXED :Percentile({FIXED [State/Province]:SUM([Sales])},0.6)}
6. Create a new calculated field as following.
Name : Percentile_0.8
Calculation : {FIXED :Percentile({FIXED [State/Province]:SUM([Sales])},0.8)}
7. Create a new calculated field as following.
Name : Group by Sales Percentile
Calculation :IF SUM([Sales])>=SUM([Percentile_0.8])
THEN "Group A"
ELSEIF SUM([Sales]) >= SUM([Percentile_0.6]) AND SUM([Sales]) < SUM([Percentile_0.8])
THEN "Group B"
ELSEIF SUM([Sales]) >= SUM([Percentile_0.4]) AND SUM([Sales]) < SUM([Percentile_0.6])
THEN "Group C"
ELSEIF SUM([Sales]) >= SUM([Percentile_0.2]) AND SUM([Sales]) < SUM([Percentile_0.4])
THEN "Group D"
ELSE "Group E"
END
8. Drag [Group by Sales Percentile] to left the of  [State/Province] on Rows.

9. Right click on [State/Province] -> Sort -> Set as following.