min_ifdefined
Aggregation functions minimum ifdefined
Note: this function will be available in GeoDMS 20.10.0 or later.
syntax
- min_ifdefined(a)
- min_ifdefined(a, relation)
definition
A variant of the minimum aggregation that results in Null where Min would report the maximum value of the Value type:
- min_ifdefined(a) results in a Parameter with the minimum of the defined values of Attribute a, or null when a holds no defined value at all.
- min_ifdefined(a, relation) results in an attribute with, per group of relation, the minimum 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 min_elem_ifdefined function.
applies to
- attribute a with Numeric or Point value type (unlike Min, not defined for string data)
- relation with value type of the group CanBeDomainUnit
conditions
- 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.
example
attribute<uint32> minNrInhRegion (Region) := min_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
| minNrInhRegion |
|---|
| 550 |
| 500 |
| 300 |
| 200 |
| null |
domain Region, nr of rows = 5
Region 4 has no cities, so Min would report 4294967294 (the maximum of uint32) there; min_ifdefined reports null.