Repository navigation
unique_count
MaartenHilferink edited this page Oct 7, 2026
·
6 revisions
Aggregation functions unique_count
- unique_count(a)
- unique_count(a, relation)
- unique_count_uint8/16/32/64(a)
- unique_count_uint8/16/32/64(a, relation)
- unique_count(a) results in a parameter with the number of different non null values of attribute a.
- unique_count(a, relation) results in an attribute with the number of different non null values of attribute a, grouped by relation. The domain unit of the resulting attribute is the values unit of the relation.
Values outside the range of the values unit of a are counted like any other value, as for modus (since 20.23.1 also with relation where the counts are kept in a table; before, that case left them out).
- attribute a with uint2, uint4, uint8, uint16, uint32 or bool value type
- relation with a value type that can be the type of a domain unit
- The values unit of the resulting data item is the cardinal type of the values unit of a unless specified by the operator suffix.
- The domain of argument a and relation must match.
The implementation is shared with the modus function, see its performance section.
attribute<uint32> countLifeStyleCode (RegionDomain) := unique_count(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
| countLifeStyleCode |
|---|
| 1 |
| 1 |
| 1 |
| 1 |
| null |
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.