Database Reference
In-Depth Information
THIS = AGGREGATE (
(YTD ([Date Order].[Calendar].CurrentMember) *
[Date Order].[Date Calculations].[Real Value]),
Measures.CurrentMember
);
END SCOPE;
The
CREATE MEMBER
statement is straightforward: it creates the calculated member
and gives it a default value of
Null
. The
SCOPE
is the part that does the magic: from
everything from the Date level up to the Calendar Semester level, when the
Year To
Date
member is selected in the
Date Calculations
hierarchy, it aggregates the set
returned by
YTD
by the
Real Value
member and the current Measure.
We can see from the screenshot that the Year-To-Date calculation works with both
Sales Amount and Gross Profit, even though we did not write any specific code for
the two measures. Moreover, the screenshot shows why the
Real Value
member is
needed: it is the reference back to the original physical space of the cube, while Year
To Date is the new virtual plane in the multidimensional space that holds the results
of our calculation.
Search WWH ::
Custom Search