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: 
deepanshuSh
Creator III
Creator III

Percentile Calculation

deepanshuSh_0-1679920326280.png

Hi, 

I want to calculate the percentile for each ID, based on the sum(value). Basically, I want to take the max(sum(value) ) as base considering it as 100% and calculate where the remaining IDs belong to. I want to understand which percentile does each ID belongs to when compared to whole data. 

 

Trial and error is the key to get unexpected results.
Labels (1)
1 Solution

Accepted Solutions
MarcoWedel

From your description I understand a percentage rather than a percentile, are you maybe looking for an expression like this:

Num(Sum(Value)/Max(TOTAL Aggr(Sum(Value),ID)),'0%')

MarcoWedel_0-1679951643332.png

?

 

View solution in original post

3 Replies
Or
MVP
MVP

Have a look at the Fractile() function.

You may need to wrap it in an aggr() function to get it working on a per-ID basis as well - I'm not sure because I wasn't quite able to understand what you were trying to do based on your post.

MarcoWedel

From your description I understand a percentage rather than a percentile, are you maybe looking for an expression like this:

Num(Sum(Value)/Max(TOTAL Aggr(Sum(Value),ID)),'0%')

MarcoWedel_0-1679951643332.png

?

 

deepanshuSh
Creator III
Creator III
Author

Thanku @MarcoWedel and @Or  for your inputs. I am trying to use the fractile function already, but was unable to get the required results. I wanted to get a summation of the value column and then use that for getting the percentile using the fractile function, I tried the alternative approach using Marco's Suggestion. It kind of solved the problem. 

 

 

Trial and error is the key to get unexpected results.