UNIQUE
Filters duplicate items from a collection resulting from a subexpression in a larger expression. An expression resulting in a collection never contains duplicate values. A subexpression with the COLLECT statement however, can contain duplicates. See the note on collections and duplicates for more info.
Syntax
Return type
Examples Suppose the following model.
Person instance | Person.name |
---|
Person_1 | “Kim” | Person_2 | “Rick” | Person_3 | “Bob” | Person_4 | “Rick” |
Expression | Result | Type | Note |
---|
COLLECT Person.name FROM ALL Person | [ "Kim" , "Rick" , "Bob" ] | String (multivalued) | A result never contains duplicate values | SIZE ( COLLECT Person.name FROM ALL Person ) | 4 | Integer | A subexpression can contain duplicate values | SIZE ( UNIQUE ( COLLECT Person.name FROM ALL Person ) ) | 3 | Integer | The collection holds three unique values |

|