Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
dselgo_eidex
Partner - Creator III
Partner - Creator III

Calculated fraction in Fractile() function

Hello, I am currently working on a complex expression using the Fractile() function. I am trying to create percentile groups of test scores, and then calculate the fractile for the upper bound of that group. Right now I have 5 percentile groups (1-20, 21-39, 40-59, 60-79, 80-100). If I wanted to get the fractile for the 1-20 percentile group I would use Fractile(expr, .2).

I'm trying to show the fractile for every test-taker based on which percentile group they belong in. So if a test-taker was in the 35th percentile, then the function should be Fractile(expr, .4). I currently have an expression that is calculating the fraction value, but it appears that Fractile() will not accept anything other than a decimal number as a parameter. I've tried the following:

=Fractile(expr, "Percentile Group")                    //.2, .4, .6, etc.
=Fractile(expr, $(="Percentile Group"))
=Fractile(expr, (Div("Percentile", 20) + 1) / 5        //0-99
=Fractile(expr, $(=(Div("Percentile", 20) + 1) / 5)

 The first parameter is fine which I have determined by passing an explicit fraction for the second parameter.

I'm wondering if it is at all possible to accomplish what I am trying above. If it isn't I can create an expression using five if statements and passing the explicit decimal values to each, but I would rather avoid that if possible.

Labels (1)
2 Replies
sunny_talwar

Where is this getting used, are you able to share a sample to show how exactly you are trying to do this?

dselgo_eidex
Partner - Creator III
Partner - Creator III
Author

Sure thing Sunny. Here is a sample QVF.

The only expression where I am having issues is the Fractile.