Database Reference
In-Depth Information
--Query 5.1
SELECT [Measures].[Sales Amount] ON COLUMNS
FROM [Adventure Works DW2012];
As a seasoned SQL developer, you can see the similarities between SQL and MDX,
the only thing in the previous query that shows that it is a MDX query is the ON
COLUMNS keyword. However, there is a big difference between MDX and SQL. From
now on, do not make any similarities between the T-SQL SELECT statement and
the MDX SELECT statement they are totally different. MDX is a positional language,
meaning that you position yourself in the multidimensional cube space through code.
What does this mean? The following figure shows a 3-dimensional cube. As you
can see from the illustration, you have a dimension called Measures , a dimension
called Time and a Product dimension. The previous query references one of the di-
mensions in the cube space ( [Measures].[Sales Amount] ) and places it on the
column's axis.
The query positions itself in the multidimensional cube space, and selects the values
from the measures dimensions that satisfy the condition [Sales Amount] . Con-
sider the following query:
--Query 5.2
SELECT [Measures].[Sales Amount] ON COLUMNS,
[Product].[Product Hierarchy].[Product
Category] ON ROWS
FROM [Adventure Works DW2012];
Search WWH ::




Custom Search