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

SIZE


Determines the size of a collection.


Syntax

SIZE ( collection )



Inputs
  • 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:

Active instanceExpressionResultType
Parent_1SIZE ( Parent.has_Children )3Integer
Parent_2SIZE ( Parent.has_Children )1Integer
noneSIZE ( Parent.has_Children )Error
Child_1SIZE ( Child.hobbies )2Integer
Child_3SIZE ( Child.hobbies )3Integer
Child_4SIZE ( Child.hobbies )1Integer

SIZE( ? )0Integer

SIZE and COUNT are similar except for ?:

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