Find Jobs
Hire Freelancers

Need a MYSQL function to calculate a percentile by group

$10-30 USD

Closed
Posted about 6 years ago

$10-30 USD

Paid on delivery
My data is in columns A-E here https://docs.google.com/spreadsheets/d/1DTb7-d7TNHZIFqm0m3sgtgS6m0M5DPzUZp1LigltKdM/edit#gid=824377488 Each reviewer (id in column C) assigned a score (column E) to companies (id in column B) I need to calculate a percentile of that score within each reviewer. E.g. if reviewer X reviewed 4 companies and gave them scores of 1,2,3,4 they will get percentiles of 0, 0.333, 0.666, 1 Further requirements are: 1) I need to be able to upload this function and use it for different datasets in statements like this select *, MyPercentile(reviewer_id, score) from rating 2) NULL scores should return NULL percentiles 3) Those NULLs should also be completely ignored in a group, i.e. imagine there are fewer values there 4) In column F of the spreadsheet, I provided the Excel calculation of those percentiles. However, I do not like how Excel handles ties. I want the percentiles for tied values to be based on the average, not on minimum, i.e. --- If all values in the group are identical, everybody gets a percentile of 0.5 (not 0, as in Excel) --- If in a large group half of the values = 1 and other half = 2, then the first half gets the percentile of 0.25 and the second gets 0.75 I provided the desired values for the first two reviewers in the MyPercentile column. I also attached the screenshot with the version of MySQL and phpmyadmin. Please say something meaningful in your proposal, not just the generic "I am an expert and I can do it" stuff.
Project ID: 16277939

About the project

7 proposals
Remote project
Active 6 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
7 freelancers are bidding on average $27 USD for this job
User Avatar
A proposal has not yet been provided
$30 USD in 1 day
5.0 (67 reviews)
5.8
5.8
User Avatar
As per your requirements you want to implement it on web or in excel? need to discuss more with you. Regards Atiar T.
$35 USD in 4 days
4.9 (13 reviews)
4.0
4.0
User Avatar
I can code your mysql query, please contact to start right away. Relevant Skills and Experience MYSQL
$25 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
A proposal has not yet been provided
$25 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
ARLINGTON, United States
5.0
111
Payment method verified
Member since Nov 25, 2013

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.