You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.
COUNT
Retrieves the number of instances for the specified entities or attributes. Please note the similar function SIZE.
Syntax
COUNT ( collection )
Input
- collection - A collection of attribute or entity instances.
Return type
- integer
Examples
Suppose the following data model.
Instance | Person.name |
---|---|
1 | “John” |
2 | “Dave” |
3 | “Jane” |
4 | “Lisa” |
Instance | House.rooms |
---|---|
singleton | “living room”, “bathroom”, “bedroom” |
Expression | Result | Type |
---|---|---|
COUNT ( ALL Person ) | 4 | Integer |
COUNT ( House.rooms ) | 3 | Integer |
COUNT ( ALL Person + ALL House ) | 5 | Integer |
COUNT ( COLLECT Person FROM ALL Person WHERE ( Person.name = “Lisa” ) ) | 1 | Integer |
COUNT ( ? (= UNKNOWN) ) | UNKNOWN | Integer |
SIZE and COUNT are similar except for ?:
SIZE( ? ) results in 0, while COUNT( ? ) results in ?
All statistical functions
- Statistical function AVG for average
- Statistical function COUNT
- Statistical function MAX
- Statistical function MIN
Expression function reference
Overview
Content Tools