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: 
Not applicable

Fractile with Calculated Field??

Hey guys, I have a question around using fractiles with calculated fields.  I want to do fractile(NumberofPurchases,.25) but that does not work and neither does fractile(count(distinct(purchases)),.25).  Help?

Customer NameNumberofPurchases

count(distinct(purchases))

Name 1

50
Name 225
Name 315
Name 42
Name 58
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It seems a bit illogical (in QV terms) the way you've stated it. Count(distinct purchases) is a single value for each row. A single value can't have a fractile.

Do you want the fractile of the 5 aggregated line values (50,25,15,2,8)? If so, try

=fractile(TOTAL aggr(count(DISTINCT purchases),[Customer Name]),.25)

-Rob

View solution in original post

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It seems a bit illogical (in QV terms) the way you've stated it. Count(distinct purchases) is a single value for each row. A single value can't have a fractile.

Do you want the fractile of the 5 aggregated line values (50,25,15,2,8)? If so, try

=fractile(TOTAL aggr(count(DISTINCT purchases),[Customer Name]),.25)

-Rob

Not applicable
Author

Thank you - this wasn't just the right answer, it was the perfect answer. 

Not applicable
Author

Please help me.

I have exam data of a class of 50 students.

Now I want to calculate the average (and, median) of top 80% students of that class.

How can I do that?
Please help.

Thanks.