Skip to main content

Introduction to MDX

Introduction to MDX

MDX is a standard query language for OLAP (online analytical processing) databases. The MDX language provides syntax for referring to cube elements. Most of the statements and functions in the language enable you to execute queries against a cube. The returned data is a result set, which can be displayed as a pivot table.

MDX also provides the capability of extending a cube definition. In particular, you can define new elements based on existing elements, and then use those new elements in MDX queries.

Business Intelligence supports MDX as follows:

  • When you create a pivot table in the Analyzer, the system generates and uses an MDX query, which you can view directly.

  • The Analyzer provides an option for directly running MDX queries.

  • You can run MDX queries in the MDX shell and see their results.

  • The system provides an API that you can use to run MDX queries.

  • Within a Business Intelligence model, you use MDX expressions and queries to define certain elements, as discussed in the following subsection.

Note that some MDX queries are too complex to create within the current user interface. You can execute such queries in the shell or via the API, but you cannot create them via drag and drop actions in the Analyzer.

For further information, see the following sources:

Note:

The system provides an implementation of MDX. Results may differ from other implementations.

MDX in Business Intelligence Models

In Business Intelligence models, you can use MDX expressions and queries in the following places:

  • Within a cube definition:

    • You use an MDX member expression to define calculated members.

    • You use an MDX set expression to define named sets.

    • You use an MDX set expression to filter the cube.

    These are all optional.

  • Within a subject area definition, you use an MDX set expression to filter the subject area. This is optional; a subject area does not have to include a filter.

  • Within a KPI (key performance indicator) definition, you can use an MDX query to define the KPI. This is optional; you can use an SQL query instead.

For information, see Defining Models for InterSystems Business Intelligence and the Implementing InterSystems Business Intelligence.

FeedbackOpens in a new tab