Databases Reference
In-Depth Information
SELECT Statement and Axis Specification
The MDX SELECT statement is used to retrieve a subset of the multidimen-
sional data from an OLAP Server. In SQL the SELECT statement is used to
retrieve columnar data, that is, data is retrieved as columns. Columnar data is
one-dimensional and therefore a single axis is sufficient for projecting this
data. In SQL you retrieve data as ROWS and COLUMNS, which is viewed as
two-dimensional data. If you consider the two-dimensional coordinate system,
you have the X and Y axes. The X axis is used for the COLUMNS and the Y
axis is used for ROWS. Multidimensional data, however, are specified in a
way such that data can be retrieved on multiple axes. Indeed, MDX provides
you with the capability of retrieving data on multiple axes.
The syntax of the SELECT statement is
SELECT [<axis_expression>, [<axis_expression>...]]
The axis_expression specified after the SELECT refers to the dimension data
you are interested in retrieving. These dimensions are referred to as axis di-
mensions because the data from these dimensions are projected onto the
corresponding axes. The syntax for axis_expression is
<axis_expression> := <set> ON Axis (axis number)
Axis dimensions are used to retrieve multidimensional result sets. A set, the
ordered collection of tuples, is defined to form an axis dimension. MDX
provides you with the capability of specifying up to 128 axes in the SELECT
statement. The first five axes have aliases. They are COLUMNS, ROWS,
PAGES, SECTIONS, and CHAPTERS. Subsequent axes are specified as Ax-
is (axis number). Take the following example:
SELECT Measures.[Internet Sales Amount] ON
COLUMNS,
[Customers].[Country].MEMBERS on ROWS,
[Product].[Product Line].MEMBERS on PAGES
Three axes are specified in the SELECT statement. Data from dimensions
Measures, Customers, and Product are mapped on to the three axes to form
the axis dimensions.
Search WWH ::




Custom Search