-
Notifications
You must be signed in to change notification settings - Fork 1
Max_index
Maarten Hilferink edited this page Apr 8, 2026
·
7 revisions
Aggregation functions max_index
- max_index(a)
- max_index(a, relation)
- max_index(a) results in a parameter with the index numbers of the maximum value of the non null values of attribute a.
- max_index(a, relation) results in an attribute with the index numbers of the maximum values of the non null values of attribute a, grouped by relation. The domain unit of the resulting attribute is the values unit of the relation.
The max_index function is not defined for string data items.
- attribute a with Numeric, Point or boolean value type.
- relation with value type of the group CanBeDomainUnit
The values unit of the resulting data item should be the domain unit of argument a.
7.184
- Without relation: O(n) where n = number of elements in the domain of a. Single pass tracking maximum value and its index.
- With relation: O(n) where n = number of elements in the domain of a. Tracks maximum value and index per group during a single pass.
parameter<Cit> max_index_NrInh := max_index(City/NrInhabitants); result = 0
attribute<City> max_index_NrInhRegion (Region) := max_index(City/NrInhabitants, City/Region_rel);
| City/NrInhabitants | City/Region_rel |
|---|---|
| 550 | 0 |
| 525 | 1 |
| 300 | 2 |
| 500 | 1 |
| 200 | 3 |
| 175 | null |
| null | 3 |
domain City, nr of rows = 7
| max_index_NrInhRegion |
|---|
| 0 |
| 1 |
| 2 |
| 4 |
| null |
domain Region, nr of rows = 5
GeoDMS ©Object Vision BV. Source code distributed under GNU GPL-3. Documentation distributed under CC BY-SA 4.0.