Introduction
This chapter explains how to write the most commonly encountered MultiDimensional eXpression (MDX) queries. You use MDX to model calculations in the MDX script within the cube designer as well as to query the cubes. Although most MDX concepts, functions, and keywords will apply to queries as well as the MDX script, the framework for developing MDX will be distinctly different in each environment.
The basic MDX query construct resembles Structured Query Language (SQL) in a sense that both languages include the SELECT
, FROM
, and WHERE
clauses. However, beyond these clauses, the two languages are very different. SQL operates on rows and columns, whereas MDX works on cube cells, tuples, and sets—concepts you must learn to get your mind around the syntax of MDX. Any errors that you encounter when authoring MDX will also refer to the same terms.
Each cube consists of a multitude of cells, with each cell identifying a single member found in each dimension. Although each cube...