OLAP Aggregate Queries : Metric Parameter : Metric Expressions

Metric Expressions
Doradus OLAP allows the metric parameter to be a list of metric expressions. A metric expression is a set of one or more algebraic clauses containing metric functions, constants, and the DATEDIFF function. Multiple clauses are combined with basic math operators (+, -, *, and /) and parentheses. This allows arbitrary calculations to be performed for selected objects. Examples of metric expressions are shown below:
MAX(Size) + COUNT(InternalRecipients.Person.Domain)
 
COUNT(*) * 2
 
SUM(Size) / COUNT(Sender.Person.MessageAddresses) / (DATEDIFF(DAY, "2013-11-01", NOW(PST)) + 1)
As with metric functions, metric expressions can be used in global and grouped aggregate queries. Multiple metric expressions can be computed in a single aggregate query. Each metric expression compute a value for each group. Computations are performed as integers or floating-point values as necessary. When a metric expression attempts to divide by 0, the metric value is returned as “Infinity”. Parentheses override default operator evaluation precedence in the usual manner. Calculations are performed across all objects or for each group when a grouping parameter is provided.