Rank is a financial function that provides a rank value for a value in a specified range. Rank is processed by Financial Reporting and does not depend on the database connection.
Rank([Reference], Order)
Rank([Reference], Order, Unique)
This formula in column B ranks the values in rows 1 through 5 in column A in descending order:
Rank([A,1:5], descending)
The result might be as follows:
East | Rank | |
---|---|---|
Cola | 16 | 2 |
Fruit Drinks | 23 | 1 |
Beer | 16 | 2 |
Diet | missing | missing |
Root Beer | 0 | 4 |
When two values are equal, they receive the same rank value. In the example above, Cola and Beer have the same value and therefore the same rank.
This formula in column B assigns the value of -1 to any nonnumeric value so it can be ranked:
Rank([A,1:5].ifNN(-1), descending)
In the following result, the missing value now has a rank of 5:
East | Rank | |
---|---|---|
Cola | 16 | 2 |
Fruit Drinks | 23 | 1 |
Beer | 16 | 2 |
Diet | missing | 5 |
Root Beer | 0 | 4 |
The following example builds on the previous example explaining how the new “unique” parameter affects the results:
This formula in column B assigns the value of -1 to any nonnumeric value so it can be ranked, and also indicates that each ranking should be unique:
Rank([A,1:5].ifNN(-1), descending, true)
In the following result, the missing value now has a rank of 5, and Beer has a value of 3 (even though it has the same data value as Cola):
East | Rank | |
---|---|---|
Cola | 16 | 2 |
Fruit Drinks | 23 | 1 |
Beer | 16 | 3 |
Diet | missing | 5 |
Root Beer | 0 | 4 |