Home > SSAS > SSAS – MDX Multidimensional Expression Basics 1

SSAS – MDX Multidimensional Expression Basics 1

There are many BI client tools out there, ProClarity Desktop Designer, Excel, Corda, Sharepoint Server BI dashboard, and even Microsoft SQL Server management studio. But as a BI developer, it’s still very important to be able to write basic MDX queries.

I use Microsoft SQL Server management studio (SSMS) to write and modify MDX queries.

The MDX SELECT Statement

The syntax of MDX was designed with SQL as a prototype. But the similarity between SQL and MDX ends there, i.e. the syntax. Like SQL, SELECT in MDX has the three main clauses SELECT, FROM, and WHERE.

SELECT clause: defines a multidimensional space that will be the result of the query. In SQL, we use a SELECT clause to define the column layout of the results. In MDX, we use SELECT clause to define the axis layout of the resulting multidimensional space.

FROM clause: the source of the data. It can be either the name of the cube, the name a dimension cube (precede with a $ sign), or another query.

WHERE clause: rules for limiting the results to a subspace. This is also called slicing.

SELECT <content of the axis> ON axis(0),

<content of the axis> ON axis(1),

<content of the axis> ON axis(2),

<content of the axis> ON axis(n)

FROM <cube name>

or use the names of axes:

SELECT <content of the axis> ON COLUMNS

<content of the axis> ON ROWS,

<content of the axis> ON PAGES

FROM <cube name>

Categories: SSAS
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: