Versions Compared

Key

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

COUNT


Use this function to retrieve the number of instances for the specified entities or attributes. Please note the similar function SIZE.


Syntax

Code Block
COUNT ( collection )


Input

  • 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”
ExpressionResultType
COUNT ( ALL Person )4Integer
COUNT ( House.rooms )3Integer
COUNT ( ALL Person + ALL House )5Integer
COUNT ( COLLECT Person FROM ALL Person WHERE ( Person.name = “Lisa” ) )1Integer
COUNT ( ? (= UNKNOWN) )UNKNOWNInteger



UI Text Box
typenote

SIZE and COUNT are similar except for ?:

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

Back to top