Hey @Max
Thanks for the reply (as always!
).
Not sure I understand what you mean? Do you want to see the calculation or do you want to see the values used in the calculation?
I’m trying to work out what the top (75th) quartile is for our sales people for a given product category and ccy , based on daily average sales. So the question im trying to answer is - how many sales do I need to make (on average per day) to be in the top quartile of sales for the given category.
I have done a little more work today and it seems the difference I was having was coming from the categories (or values) I was including in my partition calculation.
The differing numbers appear to be coming from the percentile calcualtion methodology. I understand that some calculations will consume all values in the range, then use the 75th percentile value (using an exect value from the range) - others may use a calculation where they exclude the median, then provide a percentile of the numbers. Some other will calculate the 75th pc value and where there is at tie, add the two values and divide by 2 - some other may interpolate similar to the last calculation I mentioned.
I’m just trying to understand which calculation approach the below are using:
- approx_percentile (athena) - the presto link doesnt appear to define this (from what I can find)
- percentileContOver (QS)
- percentDiscOver (QS)
For reference, I have used excel and python to try and find the correct percentile value - each with differing results (admittedly, some are the same, but others differing. I’m trying to find out the reason why I see the differing results - if i can explain these, then I can have some comfort in the query and calculations.)
Basically, I need to know what is happening ‘under the covers’ so I can explain the quartilel value (if and when questioned)
Help appreicated!
Regards,
Q