from allows only one dimension per aggregation step. But multiple dimensions may be desired (for example, ControllingArea,CostCenter), because the number of steps influences the result of average, say.
Suggested alternative definition
In the following $P_1,…,P_n$ are groupable properties, $M$ is an aggregation method and $C$ a custom aggregate. ... from ... denotes a sequence of from and with clauses ending in a from clause. The sequence can be empty if [... from ...] is enclosed in brackets.
If $A$ is an aggregate expression like in the first column, then the expression in the third column is another aggregate expression whose type is defined in the fourth column and which evaluates to the value of the single property in the single instance in the output set of the expression in the fifth column. This rule can be applied repeatedly and lead to multiple from clauses in one aggregate expression.
Aggregate expression
type of $A$
Aggregate-from expression
type
evaluates to
$A$
1, 2 or 3
$A$ from $P_1,…,P_n$ with $M$
1
groupby(($P_1,…,P_n$), aggregate($A$ as $A_1$))/aggregate($A_1$ with $M$ as $D$)
$A=C$ [... from ...]
4
$A$ from $P_1,…,P_n$ with $M$
1
groupby(($P_1,…,P_n$), aggregate($A$))/aggregate($C$ with $M$ as $D$)
from
allows only one dimension per aggregation step. But multiple dimensions may be desired (for example,ControllingArea,CostCenter
), because the number of steps influences the result ofaverage
, say.Suggested alternative definition
In the following $P_1,…,P_n$ are groupable properties, $M$ is an aggregation method and $C$ a custom aggregate. ... from ... denotes a sequence of
from
andwith
clauses ending in afrom
clause. The sequence can be empty if [... from ...] is enclosed in brackets.If $A$ is an aggregate expression like in the first column, then the expression in the third column is another aggregate expression whose type is defined in the fourth column and which evaluates to the value of the single property in the single instance in the output set of the expression in the fifth column. This rule can be applied repeatedly and lead to multiple
from
clauses in one aggregate expression.