RankAsc

The RankAsc function returns the rank of a number in a column of numbers. It works as if you were to sort the list in ascending order. In this case, the rank of the number would be its position.

RankAsc (numbers, break_col)

where:

numbers references the column that contains the numbers on which the rank is calculated.

break_col is an optional parameter that references a break column.

Note:

The RankAsc function assigns duplicate numbers the same rank. The presence of duplicate numbers affects the ranks of subsequent numbers.

The following examples show the results of inserting the RankAsc function in two separate tables.

Example 1

In this example, the RankAsc function is used on the numeric column (the column containing the numbers to rank). The results are shown in the Computed column.

RankAsc (Amount)

Table 166. RankAsc Example 1

State

City

Amount

Computed

AZ

Tucson

112

4

CA

Burbank

240

8

CA

Glendale

97

2

FL

Palmetto

70

1

MD

Laurel

97

2

MI

Detroit

208

7

MN

Eagan

159

5

NY

New York

490

9

NY

Rochester

180

6

Example 2

In this example, the RankAsc function is used on the numeric column and break_column. The results are shown in the Computed column.

RankAsc (Amount, State)

Table 167. RankAsc Example 2

State

City

Amount

Computed

AZ

Tucson

112

3

CA

Burbank

240

6

CA

Glendale

97

6

FL

Palmetto

70

1

MD

Laurel

97

2

MI

Detroit

208

5

MN

Eagan

159

4

NY

New York

490

7

NY

Rochester

180

7

Note:

The RankAsc is calculated on the SUM(col_1) and grouped by col_2.