The PeriodsToDate() component of our calculated
member's expression, PeriodsToDate([Time].[Year]), is therefore
specifying the set of all periods from the beginning of the year to the
current period. This will allow the calculation to be applied at various
points in time, and, based upon the current period, to supply the set of
"all periods through that period."
The YTD Warehouse
Sales measure is being defined, via the Sum() function, as the "sum
of a numeric expression evaluated over a set." The syntax of the Sum()
function is relatively straightforward, and can be represented as follows:
Sum((<<Set>>[, <<Numeric Expression>>]))
Sales measure inhabits the Numeric Expression portion of the Sum()
function. The Set portion of the Sum() function consists
of PeriodsToDate([Time].[Year]) within the syntax we have constructed
inside the calculated member. Its effect is to ask for a set of members
to be returned - a set of members that we can use in the Sum() function
as a basis for accumulation. The end result is that we sum the Warehouse
Sales from each of the periods, from the beginning of the Year
to the current period (ergo Year-to-Date Warehouse Sales).
Member Builder appears with our input as depicted in Illustration 5.
Calculated Member Builder with Complete MDX Expression (Compressed View)
Click the Check
button to perform a syntax check.
message box appears, as shown in Illustration 6, informing us that the
syntax is acceptable.
Illustration 6: Testing
Positive for Syntax Correctness
Click OK to
close the Calculated Member Builder, and to save our new calculated
new Calculated Member appears in the tree within the Calculated
Members folder, as depicted in Illustration 7.
Illustration 7: The New
Calculated Member in the Calculated Members Folder
NOTE: This view may not be the same as your own, depending upon
differing activities that have been conducted with the Warehouse cube in
another matter, although the actions we have performed to this point alone do
not require it, let's process the cube to make sure we are all in a similar "processed"
--> Process Cube to process the Sales cube.
on the Save the Cube dialog that appears next, as shown in Illustration
Illustration 8: Click "Yes"
to Save the Cube
on the dialog that appears next, as depicted in Illustration 9; we will
not design aggregations at present.
Illustration 9: Click "No"
to Designing Aggregations
a Cube dialog appears, as shown in Illustration 10, where we want the processing
method set to Full Process. (It may be the only option, depending upon
the status of the cube at this stage). Full processing for the Warehouse
cube will be relatively quick, so we will perform it to ensure that all is
Illustration 10: Full
Process Selected in the Process a Cube Dialog
the Full Process radio button is selected on the Process a Cube
to begin processing.
begins. The Process viewer displays various logged events, then presents
a green Processing completed successfully message, as depicted in Illustration 11.
Indication of Successful Processing Appears (Compact View)
to dismiss the viewer.
Click the Data
tab in the Cube Editor, if necessary.