Skip to main content
MDX Scripting Fundamentals (Analysis Services)

In Microsoft SQL Server Analysis Services, a Multidimensional Expressions (MDX) script is made up of one or more MDX expressions or statements that populate a cube with calculations.

An MDX script defines the calculation process for a cube. An MDX script is also considered part of the cube itself. Therefore, changing an MDX script associated with a cube immediately changes the calculation process for the cube.

To create MDX scripts, you can use Cube Designer in the SQL Server Data Tools (SSDT). For more information, see Define Assignments and Other Script Commands and Introduction to MDX Scripting in Microsoft SQL Server 2005.

For performance issues related to MDX queries and calculations, see the MDX optimization section in the SQL Server Analysis Services Performance Guide.

In This Section

Topic

Description

The Basic MDX Script (MDX)

Details the basic MDX script, including the default MDX script provided in each cube, and how MDX scripts generally function within a cube in Analysis Services.

Managing Scope and Context (MDX)

Describes how to use the CALCULATE statement, the SCOPE statement, and the This function to manage context and scope within an MDX script.

Using Variables and Parameters (MDX)

Describes how to use variables and parameters in an MDX script.

Error Handling (MDX)

Explains error handling within an MDX script.

Supported MDX (MDX)

Provides a list of supported MDX operators, statements, and functions within an MDX script.