Exercise 1: Exploring MDX Query Writing

In this exercise, you will explore an MDX script that consists of various queries. Each query is designed to increase your knowledge of MDX query writing, and will be executed against the Reseller Sales cube as developed in the previous lab.

Task 1 – Exploring MDX Query Writing

In this task, you will explore various MDX queries to better acquaint you with the query language.

  1. Open SQL Server Management Studio from Start | All Programs | Microsoft SQL Server 2008 R2 | SQL Server Management Studio.
  2. On the File menu, select Open | File.
  3. In the Open File window, navigate to the Assets folder located in the Source folder for this lab, select the MdxQueries_A.mdx file, and then click Open.
  4. In the Connect to Analysis Services window, enter the Server Name, and then click Connect.

    Note:
    You will need to enter the name of the machine that hosts Analysis Services.

  5. On the toolbar, select the Sales Analysis database.

    Figure 1

    Selecting the Sales Analysis Database

  6. Follow the instructions described at the top of the script file.

    Note:
    The script file consists of many queries, but you can only execute one query at a time. To execute a single query, select the entire statement (from, and including, the word SELECT to the semicolon), and then on the toolbar, click Execute.

Task 2 – Finishing Up

In this task, you will finish up by closing the script file.

  1. To close the MDX script file, on the File menu, select Close.