-
Notifications
You must be signed in to change notification settings - Fork 1
Max
mtbeek32 edited this page Jan 31, 2024
·
10 revisions
Aggregation functions max(imum)
- max(a)
- max(a, relation)
- max(a) results in a parameter with the maximum of the non null values of attribute a.
- max(a, relation) results in an attribute with the maximum 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 function is not defined for boolean data items, use the all function instead.
If there are no values to be aggregated for a group, the resulting value will be the minimum value for the value type of attribute a (in the example: 0, the minimum value for the value type: uint32).
- attribute a with Numeric, Point or string value type
- 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.
parameter<uint32> maxNrInh := max(City/NrInhabitants); result = 550
parameter<uint32> maxCity := max(City/CityName) ; result = ‘Utrecht’
attribute<uint32> maxNrInhRegion (Region) := max(City/NrInhabitants, City/Region_rel);
attribute<uint32> maxCityNameRegion (Region) := max(City/CityName, City/Region_rel);
City/NrInhabitants | City/CityName | City/Region_rel |
---|---|---|
550 | Amsterdam | 0 |
525 | Rotterdam | 1 |
300 | Utrecht | 2 |
500 | DenHaag | 1 |
200 | Eindhoven | 3 |
175 | Haarlem | null |
null | null | 3 |
domain City, nr of rows = 7
maxNrInhRegion | maxCityNameRegion |
---|---|
550 | Amsterdam |
525 | Rotterdam |
300 | Utrecht |
200 | Eindhoven |
0 |
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.