O'Reilly logo

Getting Started with SQL Server 2012 Cube Development by Simon Lidberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding calculations to cubes

In the previous chapter, you learned how to write simple MDX statements; in this section, 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 revenue 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required