O'Reilly logo

MDX Solutions: With Microsoft® SQL Server™ Analysis Services 2005 and Hyperion® Essbase, Second Edition by Francesco Civardi, Dylan Hai Huang, Christopher Webb, Sivakumar Harinath, George Spofford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Named Sets and Set Aliases

Building and using sets is an important part of MDX. Sometimes, it is most convenient to attach a name to a set that you've defined so that you can reference it later. As introduced in Chapter 2, standard MDX provides named sets to do just that. Both Analysis Services and Essbase extend the standard with set aliases to provide names for sets in additional contexts. (Essbase further provides tuple aliases as well.) These are also easy to use and frequently used.

The first half of this chapter builds on Chapter 4's discussion of context and execution flow to add detail to named set evaluation and use. The second half of this chapter introduces some rather involved query requirements that are solved by only a small number of features and functions working together. It both explains how some sophisticated user requests are handled and also continues to work through constructing MDX as assemblies of small simple expressions, so it may bear reading slowly and more than once.

Named Sets: Scopes and Context

Chapter 4 discussed context and query evaluation at some length. To recap briefly here, when a query is evaluated, first the slicer is evaluated, and then named sets are evaluated. This means that the slicer forms the context for all calculations performed in evaluating a named set. So, for named sets defined in the WITH section, you can make named set logic generic by relying on the slicer, or you can make it specific by adding particular members to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required