Databases Reference
In-Depth Information
Querying Using the MDX Query Editor
Just to recap what MDX is, it is a query language that allows you to query mul-
tidimensional databases similar to SQL that is used to query relational data-
bases. MDX is used to extract information from Analysis Services cubes or di-
mensions. Whereas SQL returns results along two axes — rows and columns
— MDX returns data along multiple axes. You learn about MDX in depth in
Chapters 3 and 7 ; for now, look at a simple MDX query to learn how to execute
it and view the results.
The syntax of a typical MDX query is as follows:
SELECT [<axis_specification>
[, <axis_specification>...]]
FROM [<cube_specification>]
[WHERE [<slicer_specification>]]
The MDX SELECT statement contains a SELECT clause where you specify
the data you need to retrieve across each axis and a FROM clause that is
used to specify the cube from which you retrieve the data, with an optional
WHERE clause that is used to slice a small section of data from which you
need the results.
In Analysis Services 2000, an MDX Sample application was included with the
shipping product; people used this application to send queries to cubes and re-
trieve results. In Analysis Services 2005, query editors are integrated right in
the SSMS for sending queries to SQL Server and Analysis Services. These
query editors have IntelliSense (dynamic function name completion) capabilit-
ies built in. When MDX queries are saved from the SSMS they are saved with
the extension .mdx. You can open the MDX query editor in SSMS by selecting
File New Analysis Services MDX Query as shown in Figure 2-43 or by click-
ing on the MDX query icon as shown in Figure 2-44 .
Search WWH ::




Custom Search