NthAggMeasure
An advanced measure that returns the Nth value from an ordered set of values in the referenced column across the aggregated data set. NthAggMeasure is useful for retrieving specific positioned values such as the first occurrence, second highest value, last entry, or any specific rank within ordered data. The measure supports custom ordering criteria and null value handling, making it ideal for ranking analysis, top/bottom value identification, and position-specific data retrieval in business intelligence scenarios.
Extends
- ColumnBaseMeasure 🔗
Attributes
Name | Id | Type | Lower | Upper |
---|---|---|---|---|
ignoreNulls | false | Boolean | 0 | 1 |
Boolean flag that controls whether null values are excluded from the position counting when determining the Nth value. When set to true (default), null values are ignored and do not count toward the position N, ensuring that the result always refers to the Nth non-null value. When false, null values are included in the position counting, which may result in null being returned if it occupies the Nth position. | ||||
n | false | EIntegerObject | 0 | 1 |
Integer value (1-based) that specifies which position in the ordered set to retrieve. For example, N=1 returns the first value, N=2 returns the second value, and so on. The value must be positive and should not exceed the expected number of values in the aggregated data set. If N is larger than the available values, the measure typically returns null or the last available value depending on the database implementation. |
References
Name | Type | Lower | Upper | Containment |
---|---|---|---|---|
orderByColumns | OrderedColumn🔗 | 1 | ∞ | false |
Collection of ordered columns that define the sorting criteria for determining the Nth value position. The ordering determines how values are ranked and which value corresponds to the specified position N. Multiple columns can be used for complex sorting scenarios, such as ordering by date first, then by amount. At least one OrderedColumn must be specified to ensure consistent and predictable Nth value selection. |