Database Reference
In-Depth Information
Adding calculations to cubes
In the previous chapter, you learned how to write simple MDX statements; in this sec-
tion, we will use that knowledge to extend the FirstCube cube that you have worked
on. As covered before, MDX is a language that is used when querying cubes, but it
can also be used to define objects in your cube.
In the cube designer you a have tab called Calculations ; here you can add different
types of calculations such as measures, named sets, and time calculations.
Simple calculated measures
To create a simple calculated measure such as a margin (the difference between rev-
enue and cost) calculation, perform the following steps:
1. Click on the New Calculated Member button in the cube designer.
2. Name the measure as [Margin] and add the following expression:
[Measures].[Sales
Amount]-[Measures].[Total Product Cost]
3. Specify that the format string should be Currency .
4. Select the associated measure group to be Fact Internet Sales .
5. Deploy the cube.
Search WWH ::




Custom Search