Returning data on the query axes
Each MDX query refers to one or more axes on which data should be returned. You can refer to an axis by its name (columns, rows, pages, and so on) or by its ordinal number, starting at zero. You cannot skip an axis, so each query must include columns (ordinal 0), but could also include rows (ordinal 1), pages (ordinal 2), and so on. The majority of frontend tools can only work with two axes, columns and rows, so don't let this scare you. The SELECT
clause of the query must include the definition of all the axes, and the FROM
clause defines a single cube (or perspective) from which you extract the data. The WHERE
clause contains a slicer limiting the data set specified in the query's SELECT
clause.
Getting ready
To follow the examples in this chapter, please connect to the Analysis Services 2012
instance using the SQL Server Management Studio (SSMS), right-click on the Adventure Works 2012 sample database, and go to New Query | MDX. This will open a new query...