The MDX Sum function returns the sum of values of tuples in a set.
Sum ( set [,numeric_value_expression ] )
The set containing the tuples to aggregate. If empty, the return value is #MISSING.
Optional. An expression that returns a value. Commonly used to restrict the aggregation to a slice from a Measures dimension (see MDX Grammar Rules). In the example below, [Measures].[Total Expenses] is the numeric value expression provided to the Sum function.
with
member [measure].[FFFFFF] as sum( {(measure.income), (measure.cost)}, ([Goods].[electronic product].computer) )
select { (measure.cost), (measure.income), ([measure].[FFFFFF]) } on 0,
children( [starting date].[2021].Q1 ) on 1
from [logistics.test]
where ( [Goods].[electronic product].[mobile phone], [completion date].[2020].[Q1].[M3], Transport.[railway], [starting region].[Europe].[UK], [ending region].[Europe].[Italy] );
cost | income | FFFFFF | |
M1 | 60000 | 1001 | 2014 |
M2 | 2 | 1001 | 2015 |
M3 | 3 | 1001 | 333.333 |