This statement is used to create queries that return multidimensional data, either in a Microsoft® ActiveX® Data Objects (ADO) Cellset object or in an OLE DB Dataset object.
In the <tuple> ::= (<member>[,<member>...]) syntax, each <member> value must be from a different dimension.
In the <slicer_specification> syntax, the members in the <tuple> value must be in dimensions other than those in the <axis_specification> values.
If a dimension in the cube is omitted from the <axis_specification> values and <slicer_specification> value, the dimension's default member is implicitly added to the <slicer_specification> value.
The DISTINCT keyword is ignored in data mining queries.
Like SQL, Multidimensional Expressions (MDX) syntax can contain user-readable comments that are ignored when the commands are processed. The three different character sets that indicate comments are outlined in the following table.
Characters | Scope |
---|---|
// (C++ style forward slashes) | All text after the forward slashes (/) and before the end of the same line is ignored. |
-- (SQL hyphens) | All text after the hyphens (-) and before the end of the same line is ignored. |
/*...*/ (C style slash and asterisk pairs) | All text between the opening forward slash (/) and asterisk and the closing asterisk (*) and closing forward slash (/) is ignored. This type of comment can span multiple lines. |
The following example shows the use of comments in an MDX command:
/* Using this query to view
information about units shipped
and units ordered */
SELECT
{ [Measures].[Units Shipped], [Measures].[Units Ordered] } ON COLUMNS,
// The next command specifies nonempty members only
NON EMPTY [Store].[Store Name].Members ON ROWS
FROM Warehouse -- Pulled from the Warehouse cube
For more information, see Comments in MDX.