























To specify a dataset, a Multidimensional Expressions (MDX) query must contain the following information:
This information can be complex. MDX syntax provides the information in a simple and straightforward manner, using the MDX SELECT statement.
In MDX, the SELECT statement is used to specify a dataset that contains a subset of multidimensional data. A basic MDX query is structured in the following way:
SELECT [<axis_specification>
[, <axis_specification>...]]
FROM [<cube_specification>]
[WHERE [<slicer_specification>]]
The basic MDX SELECT statement contains a SELECT clause and a FROM clause, with an optional WHERE clause. These syntax elements are shown in the following example:
SELECT
{ [Measures].[Unit Sales], [Measures].[Store Sales] } ON COLUMNS,
{ [Time].[1997], [Time].[1998] } ON ROWS
FROM Sales
WHERE ( [Store].[USA].[CA] )
The SELECT clause determines the axis dimensions of an MDX SELECT statement. Two axis dimensions are defined in this MDX query example.The FROM clause determines which multidimensional data source is to be used when extracting data to populate the result set of the MDX SELECT statement.
A WHERE clause optionally determines which dimension or member to use as a slicer dimension; this restricts the extracting of data to a specific dimension or member. The WHERE clause in this example restricts the data extract for the axis dimensions to a specific member of the Store dimension. An MDX SELECT statement supports other optional syntax elements, such as the WITH keyword, and the use of MDX functions to construct members by calculation for inclusion in an axis or slicer dimension.
The syntax format of the MDX SELECT statement is similar to that of SQL syntax; however, there are several primary differences:
SELECT
{ [Measures].[Unit Sales], [Measures].[Store Sales] } ON AXIS(0),
{ [Time].[1997], [Time].[1998] } ON AXIS(1)
FROM Sales
WHERE ( [Store].[USA].[CA] )
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。