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.
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 ...