Rank Value
The Rank Value function returns the value found at the specified position, either starting from the highest or the lowest value.
1. Syntax
RANKVAL(d0,s0,s1,s2,Alignments...)
2. Input
The Rank Value function requires the following input:
- d0 – The set of data values for which the Rank Value is calculated.
3. Parameters
The Rank Value function requires the following parameters:
- s0 – The rank position in the list of values.
- s1 – The sorting type. 0 ranks from the highest value to the lowest, while 1 ranks from the lowest to the highest.
- s2 – Whether duplicate values are considered as multiple values in the ranking. The default value is false.
- Alignments... (One or More, Optional) – Hierarchy placeholders to be used as the alignment axis. Input values are grouped by the specified hierarchy values before ranking them: e.g., RANKVAL($Quantity$, 2, null, null, $Country$) calculates the 2nd highest quantity for each country.
Tip
When using alignment parameters in a formula visualization, you can choose to display these values grouped by only the alignment hierarchy values, for example to display just the N-ranked value for each country without the original input values.
4. Output
The Rank Value function generates a single value from the data set that corresponds to the indicated rank (or for each group when using alignment parameters).