MDX Introduction and Overview |
To better understand the MDX language and the OLAP technology it supports, a basic understanding of the OLAP cube components is required.
Dimensions |
Dimensions are the top or highest categories of a cube. They contain subcategories of data known as levels and measures. A dimension can have multiple hierarchies and can be used in multiple cubes. A cube can have up to 64 dimensions.
Hierarchies |
A dimension might be categorized into different hierarchies. For example, a company might categorize its profit dimension along the verticals of geography, sales territory, or market.
Levels |
Levels are categories of organization within a dimension. Levels are hierarchical, and each level descending in a dimension is a component of the previous level. For example, a time dimension could include the following levels: Year, Quarter, Month, Week, and Day.
Members and Measures |
An additional component of a dimension and a level is a member. A member is a component of a level and is analogous to the value of a variable on an individual record in a data set. It is the smallest level of data in an OLAP cube. In addition to creating dimension members, a user can create calculated members and named sets that are based on underlying members or on other calculated members and named sets. These user-defined objects are based on evaluated query data from the cube.
Calculated members and named sets can be created in three different ways:
Query scope calculated member |
is only available during the query that defines it. It is created by using the WITH MEMBER/SET keyword. |
Session scope calculated member |
is available for the user that defines the object for the duration of that session. It is created by using the CREATE SESSION MEMBER/SET keyword. |
Global scope calculated member |
is available for anyone to use and is stored with the cube. It is created by using the CREATE GLOBAL MEMBER/SET keyword. Named sets have the same three scopes. |
Calculated members can be created in the Measures dimension and can include any combination of members. Calculated members can also be created in any other dimension and are known as nonmeasure-based calculated members. Examples of measures include sales counts, profit margins, and distribution costs.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.