has_any

aggregation-functions has_any

syntax

  • has_any(a)

definition

has_any(a) is a boolean variant of the pcount function, resulting in the value true if the number of entries of a relation in the related domain-unit is more than zero and false if this number is zero. The has_any(a) function can be defined as pcount(a) > 0.

definition

Use the has_any in stead of the pcount function in cases where not the number of cases but only the fact that cases occur is relevant, as the has_any function uses less memory.

applies to

example

attribute<uint32> has_anyReg (Region) := has_any(City/Region_rel);
City/Region_rel
0
1
2
1
3
null
3

domain City, nr of rows = 7

has_anyReg
true
true
true
true
false

domain Region, nr of rows = 5

see also