Database Reference
In-Depth Information
Listing 14-39. Using the Where Clause with an Attribute from a Different Hierarchy
Select
{ [Measures].[SalesQuantity] } On Columns,
{ NonEmpty(
CrossJoin(
[DimDates].[Year].AllMembers
, [DimTitles].[ TitlesByType ].[Title].AllMembers
)
)
} On Rows
From [CubePubsSales]
Where( [DimTitles].[ TitlesByPublisher ].[Title].[Sushi, Anyone?] );
So far, most of our queries have included the Measures dimension across the columns, but this does not
have to be the case. For example, the query in Listing 14-40 does not use the measures on the columns axis.
Instead, we have used the years. Remember that even if we do not specify the SalesQuantity measure, the
measure is used as the default member of the Measures dimension. If we want to show a different measure, we
can add the Where clause to the query to indicate which member of the Measures dimension we want. The result
of this query is shown in Figure 14-33 .
Figure 14-33. The results of the examples in Listing 14-40
Listing 14-40. Filtering the Measures Dimension with the Where Clause
Select -- Note that no measures are selected here
{ NonEmpty( [Year].AllMembers )} On Columns, -- Placing the Years across the columns
{ NonEmpty(
CrossJoin(
Search WWH ::




Custom Search