KNOWLEDGE BASE

Upper and Lower Hinge in Box Plot Different from PERCENTILE() Calculation


Published: 22 May 2017
Last Modified Date: 23 May 2017

Issue

A calculated field using the function PERCENTILE() returns different results than the upper and lower hinge of a Tableau generated Box Plot view.

Environment

Tableau Desktop

Resolution

In order to return the same results for upper/lower hinge on a Box Plot and 75th/25th percentile in a calculated field, ensure the that the level of detail used to compute the percentile is the same between views.

Cause

Box plots in Tableau Desktop use the function WINDOW_PERCENTILE(), which means that Tableau Desktop uses the level of detail in the view to compute the percentile value.

For example, in the attached example workbook on the "Box Plot - sum of sales per customer" worksheet, each circle is the sum of sales for a customer. To find the upper hinge, Tableau Desktop first sums sales up for each customer, then finds the sum that is the 75th percentile of these sums.

In comparison, the worksheet "Crosstab - sum of sales per customer" finds the same result with a calculated field with the following formula:

WINDOW_PERCENTILE( SUM( [Sales] ), .75 )

Did this article resolve the issue?