10.2. Restricting Cube Space/Slicing Cube Data

A typical cube contains several dimensions and each dimension can have several hundred or even thousands of members. For example, if you have a sales cube that contains products, the products dimension would likely have hundreds of products, if not thousands. During analysis, you would typically want to slice the data or drill down into specific sections of the cube to glean insights hidden in the data. Client tools help you to slice, dice, and drill down in cubes. These client tools dynamically generate MDX to restrict the cube space and generate queries. In this section, we refer to restricting the cube space in the context of MDX scripts or restricting the data being returned to the client when users slice and dice the data. Several ways exist to restrict the cube space when analyzing data and this section discusses using MDX to do this and appropriately retrieve the sections of the data you care about.

10.2.1. Using the SCOPE Statement

You already learned some techniques to restrict the searchable cube space, the use of which would depend on the context of your problem and what you are trying to accomplish. To refresh your memory, the SCOPE statement within MDX Scripts is used to restrict the cube space to form a subcube, which is a part of the cube projected along the dimensions specified within the SCOPE statement. The SCOPE statement is often used for cell calculations where the assignment statement typically is used with ...

Get Professional Microsoft® SQL Server® Analysis Services 2008 with MDX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.