Time for action – writing an MDX query

In this example, you will learn more about the MDX structure and how to write queries in the MDX language.

  1. Open SQL Server Management Studio, connect to the Analysis Services instance, and click on Chapter 02 SSAS Multi Dimensional, and then click on New Query.
  2. In the New Query window, write the following expression:
    select [Order Date].[Calendar Year].members on 0
    from [Internet Sales]

    You will see a list of the years, the sales amount for each year, and the grand total.

  3. Now, run the following statement:
    select [Sales Territory].[Sales Territory Country].members on 0,
    [Order Date].[Calendar].[Calendar Year].members on 1
    from [Internet Sales]
  4. Check the result and you will see the years listed in each row, the countries ...

Get Microsoft SQL Server 2014 Business Intelligence Development: Beginner’s Guide 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.