Book Image

Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide

By : Abolfazl Radgoudarzi, Reza Rad
Book Image

Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide

By: Abolfazl Radgoudarzi, Reza Rad

Overview of this book

Table of Contents (19 chapters)
Microsoft SQL Server 2014 Business Intelligence Development Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 listed in each column, and the Sales Amount measure shown in each cell, which represents the sales amount of that country in that year.

What just happened?

MDX is a query language that returns the results in a multidimensional format. In this...