Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Use this function to retrieve the number of instances for the specified entities or attributes.

Syntax

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

Return type

  • integer

Examples

Suppose the following data model.

 

InstancePerson.name
1“John”
2“Dave”
3“Jane”
4“Lisa”

 

 

InstanceHouse.rooms
singleton“living room”,  “bathroom”,  “bedroom”

 

  • COUNT(ALL Person) results in 4
  • COUNT(House.rooms) results in 3
  • COUNT(ALL Person + ALL House) results in 5
  • COUNT(COLLECT Person FROM ALL Person WHERE(Person.name = “Lisa”)) results in 1
  • COUNT(? (= UNKNOWN)) results in UNKNOWN

 

UI Text Box
typenote
SIZE and COUNT are similar except for ?: SIZE(?) = 0