Chapter 4. MDX Query Context and Execution

Having explored the basics of MDX queries, and expanded our vocabulary of functions and useful expressions, we need to turn our attention to the way that queries and statements are actually evaluated. Context and interpretation are the two major themes of this chapter. As we examine them, we will look at how MDX is supposed to function in any vendor's implementation and point out a number of important concrete aspects of Microsoft's and Hyperion's implementations. In particular, Analysis Services 2005 adds a couple of very important ways to manipulate cube context, and modifies some of the implicit behavior of its earlier versions.

Execution and session context isn't everything, but it is very important. Every portion of every query and action has a particular context within a cube's space. Part of what makes MDX powerful and useful is how the explicit parts (what you say) combine with the implicit parts (what you leave out). For example, when an expression only mentions one or two dimensions and it is used in a cube with more dimensions, the others still play a role and combine with the dimensions you do mention to produce a result. This impacts how you compose queries and calculations in MDX. The interpretation of invalid data, missing data (NULLs), and invalid members is another important area that we will cover in this chapter. Cubes that you build will usually have many cells that contain no data, and your queries will need to deal ...

Get MDX Solutions: With Microsoft® SQL Server™ Analysis Services 2005 and Hyperion® Essbase, Second Edition 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.