Skip to main content
Pentaho Documentation

Introduction to the Multidimensional Expression Language (MDX)

The Multidimensional Expression Language (MDX) is an OLAP database query and calculation language similar to SQL. It is the method by which a dataset is retrieved from a OLAP database. While you do not necessarily have to know MDX in order to use Pentaho's client tools, you should be somewhat familiar with it for the purpose testing your Mondrian schema.

If you are already familiar with SQL, then much of the MDX syntax will look familiar, and the rest should be relatively easy to learn. You can edit the MDX using Analyzer or a text editor.

There are six MDX data types:

  1. Dimension or hierarchy
  2. Level
  3. Member
  4. Tuple
  5. Scalar
  6. Set

Below is an example of a very simple MDX query:

   { [Measures].[Salesfact] } ON COLUMNS,
   { [Date].[2004], [Date].[2005] } ON ROWS
FROM Sales