Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: SUBSETOF anchor

...

Panel
bgColorwhite

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

Code Block
 UNIQUE ( collection )
  • collection - A collection of attribute or entity instances.

Examples

Suppose the following model.

 

Person instancePerson.name
Person_1“Kim”
Person_2“Rick”
Person_3“Bob”
Person_4“Rick”

 

  • COLLECT Person.name FROM ALL Person = "Kim”, “Rick”, “Bob” (a result never contains duplicate values)
  • SIZE ( COLLECT Person.name FROM ALL Person ) = 4 (a subexpression can contain duplicate values)
  • SIZE ( UNIQUE ( COLLECT Person.name FROM ALL Person ) ) = 3 (the collection holds three unique values)

Include Page
_nav_BackToTop
_nav_BackToTop

Panel
bgColorwhite

Anchor
SUBSETOF
SUBSETOF
SUBSET OF

This function returns TRUE if the items in a collection are all present in another collection.

Syntax

Code Block
 collection1 SUBSET OF collection2
  • collection1 - The collection that is tested to be a subset of the second collection.
  • collection2 - The collection that is tested to hold all the items in the first collection.

Return type

  • boolean

Diagram

Examples

  • ('a', 'b', 'c') SUBSET OF ('a', 'b', 'c', 'd') = TRUE
  • ('a', 'b', 'c', 'd') SUBSET OF ('a', 'b', 'c') = FALSE
  • (Person.hobbies) SUBSET OF ([“Tennis”, “Soccer”, “Music”]) = TRUE if Person.hobbies = “Tennis”, “Soccer”
  • (Person.hobbies) SUBSET OF ([“Tennis”, “Soccer”, “Music”]) = UNKNOWN if Person.hobbies = ?
  • (Person.hobbies) SUBSET OF ([“Tennis”, “Soccer”, ?]) = FALSE if Person.hobbies = “Tennis”, “Soccer”
    • Because: ["Tennis", "Soccer", ?] evaluates to [?] and (Person.hobbies) SUBSET OF [?] = FALSE
  • ('a', 'b', 'c') SUBSET OF (['a', 'b', 'c']) will result in an error.
UI Text Box
typenote
Values between single quotes are considered value list items. For backwards compatibility reasons, a comma separated sequence of value list items is treated as a collection. That's why there is no need to enclose the values between square brackets. In fact if you do add the square brackets you create a matrix rather than a list.

Include Page
_nav_BackToTop
_nav_BackToTop

...