The [Conditional Forecast Cost] is generated by following SCOPE-Statements based on measures called "Cost" and "Forecast Cost".
These Statements work fine but it is too slow. Especially if the whole YEAR is choosen in the report (or even more Years). Waiting time can be more than 5 Minutes. Any Idea how to optimize this MDX ?
SCOPE ([Measures].[Conditional Forecast Cost]);
THIS = (IIF([DIM Date].[Half Year].&[1],[Measures].[Cost], [Measures].[Forecast Cost]));
END SCOPE;
SCOPE ([DIM Date].[Iso Month].[All].children, [Measures].[Forecast Costs]);
THIS = SUM(
Descendants(
[DIM Date].[Iso Month].CurrentMember,
[DIM Date].[Iso Month]
),
[Measures].[Conditional Forecast Cost]
);
END SCOPE;
Background information:
First Statement represents the basic Logic.
That works fine as long as we are reporting on a monthly Level.
So the second SCOPE Statement with the Descendants Function forces the engine to do the aggregation from the lower monthly level. That works so far but it is really slow.
Additional information:
Your IIF describes two sub-cubes => the SCOPE job. Transform it to such form (simplified):
MEASURES.[Conditional Forecast Cost] = [Measures].[Forecast Cost]
SCOPE([DIM Date].[Half Year].&[1])
MEASURES.[Conditional Forecast Cost] = [Measures].[Cost];
END SCOPE;