Problems / Cumulative Distribution / Editorial
CUME_DIST() calculates the fraction of rows in the partition that have a value less than or equal to the current row's value.
CUME_DIST()
Formula: count(rows with value <= current) / count(all rows in partition)
count(rows with value <= current) / count(all rows in partition)
department
salary
CUME_DIST
Key difference from PERCENT_RANK: CUME_DIST ranges from 1/N to 1.0, while PERCENT_RANK ranges from 0.0 to 1.0.
PERCENT_RANK
1/N
1.0
0.0
Solve Cumulative Distribution yourself →