Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 10. Introduction to MDX > Writing Your First MDX Queries

Writing Your First MDX Queries

We’ll begin by entering queries directly into the query editor window in SSMS. To do this, start SSMS, and connect to your SQL Server Analysis Services (SSAS) instance and Adventure Works DW sample. Next, select the OLAP cube from the SSMS Object Explorer, and then click the New Query button to open a new MDX query editor window. The principal use of new queries is twofold: to generate particular types of reports or as the result of directly manipulating cube data in a client interface, such as a pivot table that supports direct query generation. A basic MDX query contains a SELECT statement, a definition for the COLUMNS axis, a definition for the ROWS axis, and the source cube. So a simple but meaningful query we can write against Adventure Works is shown here as well as in Figure 10-1:

SELECT [Measures].[Internet Sales Amount] ON COLUMNS,
    [Customer].[State-Province] ON ROWS
FROM [Adventure Works]


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial