Skip to content
mtbeek32 edited this page Jan 2, 2023 · 12 revisions

Aggregation functions max(imum)

syntax

  • max(a)
  • max(a, relation)

definition

description

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) .

applies to

conditions

  1. The values unit of the resulting data item should match with regard to value type and metric with the values unit of attribute a.
  2. The domain of argument a and relation must match.

example

parameter maxNrInh := max(City/NrInhabitants); result = 550 parameter maxCity  := max(City/CityName)     ; result = ‘Utrecht’ attribute maxNrInhRegion    (Region) := max(City/NrInhabitants, City/Region_rel);   attribute 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

see also

Clone this wiki locally