-
Notifications
You must be signed in to change notification settings - Fork 1
unique_count
Maarten Hilferink edited this page Apr 8, 2026
·
2 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.
- 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.
- Without relation: O(n) where n = number of elements in the domain of a. Uses value tracking to count unique occurrences.
- With relation: O(n) where n = number of elements in the domain of a. Tracks unique values per group.
- Memory usage depends on the cardinality of the values unit.
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
| modusLifeStyleCode |
|---|
| 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.