1
0
mirror of https://github.com/django/django.git synced 2024-12-26 11:06:07 +00:00

[4.2.x] Fixed #34325 -- Corrected wording in PercentRank() docs.

This is consistent with the terminology used for the percent_rank()
function in SQLite docs and PostgreSQL docs.

Backport of 7bb741d787 from main
This commit is contained in:
dennisvang 2023-02-10 12:11:31 +01:00 committed by Mariusz Felisiak
parent a0623b117c
commit 4a89aa25c9

View File

@ -1758,16 +1758,16 @@ more frequently.
.. class:: PercentRank(*expressions, **extra) .. class:: PercentRank(*expressions, **extra)
Computes the percentile rank of the rows in the frame clause. This Computes the relative rank of the rows in the frame clause. This computation is
computation is equivalent to evaluating:: equivalent to evaluating::
(rank - 1) / (total rows - 1) (rank - 1) / (total rows - 1)
The following table explains the calculation for the percentile rank of a row: The following table explains the calculation for the relative rank of a row:
===== ===== ==== ============ ============ ===== ===== ==== ============ =============
Row # Value Rank Calculation Percent Rank Row # Value Rank Calculation Relative Rank
===== ===== ==== ============ ============ ===== ===== ==== ============ =============
1 15 1 (1-1)/(7-1) 0.0000 1 15 1 (1-1)/(7-1) 0.0000
2 20 2 (2-1)/(7-1) 0.1666 2 20 2 (2-1)/(7-1) 0.1666
3 20 2 (2-1)/(7-1) 0.1666 3 20 2 (2-1)/(7-1) 0.1666
@ -1775,7 +1775,7 @@ Row # Value Rank Calculation Percent Rank
5 30 5 (5-1)/(7-1) 0.6666 5 30 5 (5-1)/(7-1) 0.6666
6 30 5 (5-1)/(7-1) 0.6666 6 30 5 (5-1)/(7-1) 0.6666
7 40 7 (7-1)/(7-1) 1.0000 7 40 7 (7-1)/(7-1) 1.0000
===== ===== ==== ============ ============ ===== ===== ==== ============ =============
``Rank`` ``Rank``
-------- --------