max_alldefined
Aggregation functions maximum alldefined
Note: this function will be available in GeoDMS 20.10.0 or later.
syntax
- max_alldefined(a)
- max_alldefined(a, relation)
definition
A variant of the maximum aggregation that only results in a value when all aggregated values are defined:
- max_alldefined(a) results in a Parameter with the maximum of the values of Attribute a, or Null as soon as any value of a is null (and for an empty domain).
- max_alldefined(a, relation) results in an attribute with, per group of relation, the maximum of the values, or null for groups containing any null value (and for empty groups). The Domain unit of the resulting attribute is the Values unit of the relation.
Where no null value is involved, max_alldefined equals Max. It is the aggregation analogue of the elementwise max_elem_alldefined function.
applies to
- attribute a with Numeric or Point value type (unlike Max, 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> maxNrInhRegion (Region) := max_alldefined(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 |
| null |
| null |
domain Region, nr of rows = 5
Region 3 contains a null value and region 4 has no cities, so both result in null.