Database Reference
In-Depth Information
5.
Click Connect to open a connection to the ssAs server in object Explorer, as shown
in Figure 14-6 .
6.
Click the new Query button to create a new MDX coding window, as circled in
Figure 14-6 .
Figure 14-6. Launching a new MDX query window
7.
when the new Query window opens, type in the MDX code shown in Listing 14-9.
Listing 14-9. Code for Exercise 14-1
-- Write a Query that returns the Sales Qty by Store "BookBeat"
-- Version 1: Using a member's name
Select
{ [Measures].[SalesQuantity] } on Columns,
{ [DimStores].[Store].[Store].[BookBeat] } On Rows -- Using the Name
From [CubePubsSales]
GO
-- Version 2: Using a member's key
Select
{ [Measures].[SalesQuantity] } on Columns,
{ [DimStores].[Store].&[6] } On Rows -- Using the Key
From [CubePubsSales]
GO
-- Version 3: Using a member's key and the default measure
Select [DimStores].[Store].&[6] On Columns
From [CubePubsSales]
GO
Highlight the first version of the select statement from the code you typed in, right-click the highlighted code,
and select Execute. Alternately, you can run the query by clicking the “! Execute” button on the toolbar.
8.
Verify that your results match the results shown in Figure 14-7 .
Search WWH ::




Custom Search