Database Reference
In-Depth Information
6. Expand the Databases node and right-click on the SSAS Cookbook
Chapter 10 database. Go to New Query … | MDX .
How to do it…
Hold on a second! We just told the SQL Server Management Studio that we are go-
ing to run MDX queries against a Tabular database. Can this be right? It is because
SSMS doesn't actually know the difference between MDX and DAX but the Analysis
Services data provider does. We can actually run both MDX and DAX queries in the
query window. Let's get started.
DAX queries can be quite simple. One of the core missions of SSAS Tabular and
Power Pivot was to keep things just as simple as possible. In MDX, users had to
learn a lot of new concepts such as measure groups, dimensions, hierarchies, levels,
sets, and tuples. In the Tabular world, we use simple concepts such as tables, meas-
ures, and columns. Adhering to that goal, let us execute the following steps:
1. We introduce the EVALUATE statement that really means "show me a table."
In the query window, type the following query:
EVALUATE Customer
2. Click on the Execute button on the toolbar, and you will see the entire con-
tent of the Customer table displayed in the results grid.
A lot of information is returned by the query. We can return a subset of
columns by using the SUMMARIZE function. This function takes the table
name followed by any number of column names.
3. Enter the following query script, select the text, and click on Execute .
EVALUATE SUMMARIZE(Customer, [FirstName],
[LastName])
When executed, the query only returns two columns:
Search WWH ::




Custom Search