Date: Fri, 24 Mar 2023 03:32:04 +0000 (UTC) Message-ID: <393213559.89337.1679628724021@1323b43bed1d> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_89336_904280158.1679628724020" ------=_Part_89336_904280158.1679628724020 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html EXAMPLE - RANK Functions

# EXAMPLE - RANK Functions

This example demonstrates you to generate a ranked order of values.

Functions:

=20 =20 =20 =20 =20 =20 =20 =20 =20
Item Description
RANK Function Computes the rank of an ordered set of value wi= thin groups. Tie values are assigned the same rank, and the next ranking is= incremented by the number of tie values.
DENSERANK Function Computes the rank of an ordered set of va= lue within groups. Tie values are assigned the same rank, and the ne= xt ranking is incremented by 1.

Source:

The following dataset contains lap times for three racers in a four-lap = race. Note that for some racers, there are tie values for lap times.

Runner Lap Time
Dave 1 72.2
Dave 2 73.31
Dave 3 72.2
Dave 4 70.85
Mark 1 71.73
Mark 2 71.73
Mark 3 72.99
Mark 4 70.63
Tom 1 74.43
Tom 2 70.71
Tom 3 71.02
Tom 4 72.98

Transformation:

You can apply the `RANK()` function to the ```Ti= me``` column, grouped by individual runner:

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
Transformation Name ```= Window``` `RANK()` `Runner` `Time`
=20

You can use the `DENSERANK()` function on the same colum= n, grouping by runner:

=20
=20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20 =20
Transformation Name ```= Window``` `DENSERANK()` `Runner` `Time`
=20

Results:

After renaming the columns, you have the following output:

Runner Lap Time Rank Rank-Dense
Mark 4 70.63 1 1
Mark 1 71.73 2 2
Mark 2 71.73 2 2
Mark 3 72.99 4 3
Tom 2 70.71 1 1
Tom 3 71.02 2 2
Tom 4 72.98 3 3
Tom 1 74.43 4 4
Dave 4 70.85 1 1
Dave 1 72.2 2 2
Dave 3 72.2 2 2
Dave 2 73.31 4 3

=20
=20

=20

=20
• =20
Page:<= /span>=20
=20
• =20
• =20
Page:<= /span>=20
=20
• =20
=20

=20
=20
=20

------=_Part_89336_904280158.1679628724020--