O'Reilly logo

MDX with Microsoft SQL Server 2008 R2 Analysis Services: Cookbook by Tomislav Piasevoli

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

Displaying random values

Random values are fun, but there's something more to them. They are great for learning how SSAS engine evaluates a query and its parts. Even if you're not interested in getting random values, you'll still profit from reading this recipe by learning important concepts in MDX that you can apply in other situations.

This recipe shows how to get random values in queries that operate on cubes. Subsequent recipes show how to use those random values to sample hierarchy members or generate interesting reports.

Getting ready

Start SQL Server Management Studio and connect to your SSAS 2008 R2 instance. Click on the New Query button and check that the target database is Adventure Works DW 2008R2.

In this example, we're going to use ...

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