Database Reference
In-Depth Information
Chapter 6. MDX
In this chapter, we will cover:
• Returning data on the query axes
• Limiting the query output
• Sorting the query output
• Defining query-level calculations and named sets
• Navigating dimension hierarchies
• Working with the Time dimension
• MDX script's functionality
• Monitoring and tuning MDX queries
Introduction
This chapter explains how to write the most commonly encountered MultiDimension-
al eXpression ( MDX ) queries. You use MDX to model calculations in the MDX script
within the cube designer as well as to query the cubes. Although most MDX concepts,
functions, and keywords will apply to queries as well as the MDX script, the frame-
work for developing MDX will be distinctly different in each environment.
The basic MDX query construct resembles Structured Query Language ( SQL ) in a
sense that both languages include the SELECT , FROM , and WHERE clauses. However,
beyond these clauses, the two languages are very different. SQL operates on rows
and columns, whereas MDX works on cube cells, tuples, and sets—concepts you
must learn to get your mind around the syntax of MDX. Any errors that you encounter
when authoring MDX will also refer to the same terms.
Each cube consists of a multitude of cells, with each cell identifying a single member
found in each dimension. Although each cube could contain many dimensions, let's
consider a cube with only three dimensions:
Time : This dimension contains only one attribute: Year
Product : This dimension contains two attributes: Product Name and Product
Color
Country of sale : This dimension contains only one attribute: Country
Search WWH ::




Custom Search