Chapter 72. Programming MDX Queries

IN THIS CHAPTER

  • Cube addressing basics

  • MDX SELECT statements

  • Commonly used MDX functions

  • MDX named sets and calculated members

  • Adding named sets, calculated members, and business intelligence to cube definitions

Multidimensional Expressions (MDX) is to Analysis Services what SQL is to the relational database, providing both definition (DDL) and query (DML) capabilities. MDX queries even look somewhat like SQL, but the ideas behind them are dramatically different. Certainly, MDX returns multidimensional cell sets instead of two-dimensional result sets, but more important, MDX does not contain a JOIN statement, as the cube contains explicit relationships between all the data it summarizes. Instead, hierarchically organized dimension data is manipulated in sets to determine both the content and structure of the result.

Learning to write basic MDX queries goes quickly for most people, especially those with other database experience. However, many beginners have a tendency to stall at the basic query level. This learning plateau seems to stem from a lack of understanding of only a dozen or so terms and concepts. These are the same concepts presented at the beginning of this chapter: tuples, sets, the parts of a dimension, and so on.

To avoid being stalled, attack MDX in manageable bites:

  1. Read the "Basic Select Query" section following this list, and then practice basic queries until you become comfortable with them.

  2. Return to and reread "Basic Select Query

Get Microsoft® SQL Server® 2008 Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.