Skip to content

PercentRank

Calculates the relative rank of each row within a partition as a percentage, ranging from 0 to 1.

Category: window

Syntax:

PercentRank()

Returns: Float

Context Filtering: ✓ Yes

Parameters

This function takes no parameters. The percent rank is determined by the ORDER BY clause in the window specification.

Validation

  • Minimum parameters: 0
  • Maximum parameters: 0

Examples

PercentRank()

Returns the relative rank of each row as a percentage between 0 and 1.

PercentRank()

When ordered by sales, the lowest sales gets 0.0, the highest gets 1.0, and middle values are distributed proportionally. Result: Values range from 0.0 to 1.0

PercentRank()

Useful for determining percentile positions, such as identifying the top 10% or bottom 25% of performers.

  • Rank - Assigns rank with gaps
  • DenseRank - Assigns rank without gaps
  • CumeDist - Calculates cumulative distribution
  • Ntile - Divides rows into groups
  • RowNumber - Assigns sequential row numbers