4 Replies Latest reply on Mar 11, 2017 8:42 AM by Jonathan Drummey

# Quartiles with Dynamic Date Selection

Hello All,

I am new to Tableau. Need to Divide Student Population into 4 quartiles based on the classes they have completed in a selected period. The user can select the period they want to. Though not ideal, a Pie Chart as a Viz is preferred by the user. I am using Version 9.2 which does not support PERCENTILE function but does have a PERCENTILE_RANK function. Please help. Attaching Packaged Workbook.

• ###### 1. Re: Quartiles with Dynamic Date Selection

Rody Zakovich Jonathan Drummey I have seen few posts from you on the similar topic..but not able to replicated the behavior in version 9.2 with Viz as a pie chart...can you please help?

Raj

• ###### 2. Re: Quartiles with Dynamic Date Selection

Hi Raj,

Here's a view built using the PERCENTILE() function (it is available in 9.2).

The view is built using nested Level of Detail expressions, for more information about LOD expressions see Level of Detail (LOD) Expressions | Drawing with Numbers for more info.

Courses per Student has the formula {INCLUDE [Id] : COUNT([Course ID])} and counts the number of courses per student.

Then each of the measures selected has a formula using Courses per Student and another include LOD to get the percentile, here's the >50-75 measure:

IF [Courses per Student] > {INCLUDE : PERCENTILE([Courses per Student], .5)}

AND [Courses per Student] <= {INCLUDE : PERCENTILE([Courses per Student], .75)} THEN

[Id]

END

Then the view is built out using Measure Names/Values and is totally responsive. Note that there are bands with no students because there are only 5 values of Courses per Student.

Here's an alternative view where I used a FIXED LOD and then binned it (so I could get domain completion and a histogram-like view in v9.2, in Tableau 10.0 and up we can avoid the bin) to do a % of total for each # of courses:

Note that in this view the filter on Completed on is a context filter, that is necessary to affect FIXED LOD expressions.

v9.2 workbook is attached.

1 of 1 people found this helpful
• ###### 3. Re: Quartiles with Dynamic Date Selection

Thanks Jonathan Drummey . I guess I know what the problem with my PERCENTILE Function in 9.2. I am on the LIVE connection and connecting to mysql DB. When I change it to extract it works. I guess the PERCENTILE function is not support when connecting to DB. Correct?