Skip to content
cicada edited this page Dec 7, 2022 · 11 revisions

title: Modus permalink: /Modus/

Aggregation functions modus

syntax

  • modus(a)
  • modus(a, relation)

definition

description

An attribute might contain multiple most occurring non null values. In these cases, the modus function results in the lowest most occurring non null value, independent from the sequence of the values in the attribute, see also example 2.

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.

since version

5.15

example 1

parameter modusLifeStyleCode                      := modus(City/LifeStyleCode); result = 1 attribute modusLifeStyleCodeRegion (RegionDomain) := modus(City/LifeStyleCode, City/Region_rel);

City/LifeStyleCode City/Region_rel
2 0
0 1
1 2
0 1
1 3
1 null
null 3

domain City, nr of rows = 7

modusLifeStyleCode
2
0
1
1
null

domain Region, nr of rows = 5

example 2

parameter modusSeqA := modus(City/SeqA); result = 1 parameter modusSeqB := modus(City/SeqB); result = 1 parameter modusSeqC := modus(City/SeqC); result = 1 parameter modusSeqD := modus(City/SeqD); result = 1

City/LifeStyleCode City/Region_rel
2 0
0 1
1 2
0 1
1 3
1 null
null 3

domain City, nr of rows = 7

modusLifeStyleCode
2
0
1
1
null

domain Region, nr of rows = 5

see also

Clone this wiki locally