You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

UNIQUE


The UNIQUE function filters duplicate items from a collection. 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

 UNIQUE ( collection )


Input
  • collection - A collection of attribute or entity instances.


Return type

  • collection


Examples

Suppose the following model.


Person instancePerson.name
Person_1“Kim”
Person_2“Rick”
Person_3“Bob”
Person_4“Rick”
ExpressionResultTypeNote
COLLECT Person.name FROM ALL Person[ "Kim" , "Rick" , "Bob" ]String (multivalued)A result never contains duplicate values
SIZE ( COLLECT Person.name FROM ALL Person )4IntegerA subexpression can contain duplicate values
SIZE ( UNIQUE ( COLLECT Person.name FROM ALL Person ) )3IntegerThe collection holds three unique values



Back to Top

  • No labels