Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added explanation of why ["a"] SUBSET OF ["a", ?] returns FALSE

...

Panel
bgColorwhite

LIST

Use this function to create a list based on a value. It is the inverse of the UNPACK function.

Syntax

Code Block
LIST attribute/collection
  • attribute - An attribute of any data type.
  • collection/list - A collection or list of values.

Return type

  • a multivalued list with entries of any type

Examples

  • LIST("Blueriq") = ["Blueriq"]
  • LIST(5) = [5]
  • LIST(?) = []

Suppose the following data model.

 

Person.namePerson.SequenceNumber
“Bob”654
“Jane”523
“Mary”667
“Rick”500
“Ron”490
“Jenny”?
  • LIST(COLLECT Person.name FROM ALL Person) = ["Bob", "Jane", "Mary", "Rick", "Ron", "Jenny"]
    • In this example the LIST function adds no value, as the result of the COLLECT is already a list.
  • LIST(COLLECT Person.SequenceNumber FROM ALL Person) = []
    • As Jenny has an unknown sequence number, the result of the COLLECT expression is ?. The LIST function creates an empty list in case the parameter has ? value.

Include Page
_nav_BackToTop
_nav_BackToTop

Panel
bgColorwhite

SIZE

This function determines the size of a collection.

Syntax

Code Block
SIZE ( collection )
  • collection - A collection of attribute or entity instances. This can be an expression or a relation attribute for instance.

Return type

  • integer

Example

Suppose you have a Parent and a Child entity, where Parent has a multivalued relation with Child via the relation Parent.has_Children. With this model the following instances are created:

 

Parent instanceChild instanceChild.nameChild.hobbies
Parent_1Child_1“Kim”“Reading”, “Dancing”
Parent_1Child_2“Rick”“Tennis”, “Dancing”
Parent_1Child_3“Bob”“Painting”, “Basketball”, “Reading”
Parent_2Child_4“Mary”“Football”

 

Then:

  • if Parent_1 is active, SIZE ( Parent.has_Children ) = 3
  • if Parent_2 is active, SIZE ( Parent.has_Children ) = 1
  • without an active Parent instance, SIZE ( Parent.has_Children ) results in an error
  • if Child_1 is active, SIZE ( Child.hobbies ) = 2
  • if Child_3 is active, SIZE ( Child.hobbies ) = 3
  • if Child_4 is active, SIZE ( Child.hobbies ) = 1
  • SIZE ( ? ) = 0

 

UI Text Box
typenote

SIZE and COUNT are similar except for ?:

SIZE(?) results in 0, while COUNT (?) results in ?

 

Include Page
_nav_BackToTop
_nav_BackToTop

...

Panel
bgColorwhite

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

...