Hi,
I have 5 measures of sum type in my SSAS cube: measureA, measureB, measureC
And I have a calculated member in the query level that is the sum of the 3 measures.
The problem: When I call the aggregate or sum function with a date range, the value of the sum is huge, greather than the real value ( I need the aggregate function because I get the sum of the measures in two different periods, so I cannot slice the cube ).
But when I call the aggregate for each measure, and after all I sum the aggregated members, works fine.
Example: ( Not work )
with member totalMeasures as
measureA + measureB + measureC
with member TotalMeasuresInRange1 as
aggregate( Date.Datekey.Begin1:Date.DateKey.End1, totalMeasures )
with member TotalMeasuresInRange2 as
aggregate( Date.Datekey.Begin2:Date.DateKey.End2, totalMeasures )
Example: ( Work )
with member TotalMeasureA1 as
aggregate( Date.Datekey.Begin1:Date.DateKey.End1, measureA )
with member TotalMeasureB1 as
aggregate( Date.Datekey.Begin1:Date.DateKey.End1, measureB )
with member TotalMeasureC1 as
aggregate( Date.Datekey.Begin1:Date.DateKey.End1, measureC )
with member TotalMeasureA2 as
aggregate( Date.Datekey.Begin2:Date.DateKey.End2, measureA )
with member TotalMeasureB2 as
aggregate( Date.Datekey.Begin2:Date.DateKey.End2, measureB )
with member TotalMeasureC2 as
aggregate( Date.Datekey.Begin2:Date.DateKey.End2, measureC )
member TotalMeasuresInRange1 as
TotalMeasuresA1 + TotalMeasureB1 + TotalMeasureC1
member TotalMeasuresInRange2 as
TotalMeasuresA2 + TotalMeasureB2 + TotalMeasureC2
Why the first example doesn't work? The query is very big in the second example, especially when we think about a case with more measures, 10, 20 measures. I wish something that works more like the first example.
Best Regards,
Luis