-
Notifications
You must be signed in to change notification settings - Fork 22
Count (link path) (OLAP)
[Table of Contents](https://github.com/dell-oss/Doradus/wiki/OLAP Databases: Table-of-Contents) | Previous | Next
Doradus Query Language: Count (link path)
The `COUNT` function can be used on a link field or a field path ending with a link. It produces a count of the link values relative to each perspective object; the count can then be used in a comparison clause. For example:
COUNT(DirectReports) > 0
This clause returns true for a perspective object if it has at least one DirectReports
value.
When a link path is used, the number of leaf link values are counted. For example:
COUNT(InternalRecipients.MessageAddress.Person) > 5
This clause returns true if the total of all InternalRecipients.MessageAddress.Person
values is > 5. Some InternalRecipients
may not have a MessageAddress
value, and some MessageAddress
objects may not have a Person
value.
The link values to be included in a COUNT
function can be filtered by using the WHERE
function. For example:
COUNT(DirectReports.WHERE(LastName=Smith)) > 0
This clause returns true for objects that have at least one direct report whose last name is Smith
. Note that the WHERE
expression is specified immediately after the link name to be filtered. The parameter to the WHERE
function is an expression relative to the link field. In this example, LastName
must be a scalar field belong to DirectReports
' extent table.
The parameter to the WHERE
function can be a link path. For example:
COUNT(InternalRecipients.WHERE(MessageAddress.Person.LastName=Smith)) > 5
This clause returns true for messages that have at least 5 internal recipients whose last name is Smith.
Technical Documentation
[Doradus OLAP Databases](https://github.com/dell-oss/Doradus/wiki/Doradus OLAP Databases)
- Architecture
- OLAP Database Overview
- OLAP Data Model
- Doradus Query Language (DQL)
- OLAP Object Queries
- OLAP Aggregate Queries
- OLAP REST Commands
- Architecture
- Spider Database Overview
- Spider Data Model
- Doradus Query Language (DQL)
- Spider Object Queries
- Spider Aggregate Queries
- Spider REST Commands
- [Installing and Running Doradus](https://github.com/dell-oss/Doradus/wiki/Installing and Running Doradus)
- [Deployment Guidelines](https://github.com/dell-oss/Doradus/wiki/Deployment Guidelines)
- [Doradus Configuration and Operation](https://github.com/dell-oss/Doradus/wiki/Doradus Configuration and Operation)
- [Cassandra Configuration and Operation](https://github.com/dell-oss/Doradus/wiki/Cassandra Configuration and Operation)