-
Notifications
You must be signed in to change notification settings - Fork 1
max_ifdefined
MaartenHilferink edited this page Aug 8, 2026
·
1 revision
Aggregation functions maximum ifdefined
Note: this function will be available in GeoDMS 20.10.0 or later.
- max_ifdefined(a)
- max_ifdefined(a, relation)
A variant of the maximum aggregation that results in null where max would report the minimum value of the value type:
- max_ifdefined(a) results in a parameter with the maximum of the defined values of attribute a, or null when a holds no defined value at all.
- max_ifdefined(a, relation) results in an attribute with, per group of relation, the maximum of the defined values, or null for groups in which no defined value occurs (including empty groups). The domain unit of the resulting attribute is the values unit of the relation.
It is the aggregation analogue of the elementwise max_elem_ifdefined function.
- attribute a with Numeric or Point value type (unlike max, not defined for string data)
- relation with value type of the group CanBeDomainUnit
- The values unit of the resulting data item should match with regard to value type and metric with the values unit of attribute a.
- The domain of argument a and relation must match.
attribute<uint32> maxNrInhRegion (Region) := max_ifdefined(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
| maxNrInhRegion |
|---|
| 550 |
| 525 |
| 300 |
| 200 |
| null |
domain Region, nr of rows = 5
Region 4 has no cities, so max would report 0 (the minimum of uint32) there; max_ifdefined reports null.
GeoDMS ©Object Vision BV. Source code distributed under GNU GPL-3. Documentation distributed under CC BY-SA 4.0.