Database Reference
In-Depth Information
Listing 14-16. Code for Exercise 14-2
Select
{
[Measures].[SalesQuantity]
, [Measures].[NumberOfSales]
} On Columns,
{
( [DimStores].[Store].[BookBeat] )
,( [DimStores].[Store].[Eric The Read Books] )
} On Rows
From [CubePubsSales];
3.
Highlight the first version of the select statement from the code you entered, right-
click the code, and choose Execute. Alternately, you can run the query by clicking the
“! Execute” button on the toolbar.
4.
Verify that your results match the results shown in Figure 14-11 .
Figure 14-11. The results of Exercise 14-2
in this exercise, you wrote and executed an MDX query that returned four tuples. Let's continue our coverage
of the MDX language by looking at various aspects of dimensional members and levels.
Calculated Members
You can add calculated members to your cube from Visual Studio, and you can also add calculated members to
the results of an MDX query. The difference is that MDX's calculated member code query is not stored within the
cube. It is added as an expression each time you write a query.
Listing 14-17 is an example of a query that includes a calculated member expression. Notice that the query
begins with the WITH MEMBER clause and then indicates which dimension the member is to be placed within.
Figure 14-12 displays the query results.
 
Search WWH ::




Custom Search