Database Reference
In-Depth Information
when using the * operator for multiple cross joins, it is important to use parentheses to indicate the order
of operation. Parentheses are not necessary when using the CrossJoin function on its own.
Note
Listing 14-37. Joining More Than Two Dimensions
-- Using the CrossJoin operator
Select
{ [Measures].[SalesQuantity] } On Columns,
{ NonEmpty(
[DimDates].[Year].AllMembers
* -- Combine one set of results
[DimTitles].[TitlesByType].[Title].AllMembers
)
* -- Then cross join to those results
[DimStores].[Store].AllMembers
} On Rows
From [CubePubsSales];
-- Using the CrossJoin function
Select
{ [Measures].[SalesQuantity] } On Columns,
{
NonEmpty(
CrossJoin (
[DimDates].[Year].AllMembers
,[DimTitles].[TitlesByType].[Title].AllMembers
,[DimStores].[Store].AllMembers
)
)
} On Rows
From [CubePubsSales];
Where Clause
After receiving a large amount of data, you may want to focus on a specific slice of the result. You can use the
Where clause to do so, as shown in Listing 14-38. The results of this query will exclude anything that is not part of
the Store member News & Brews, as shown in Figure 14-31 .
Figure 14-31. The results of the example in Listing 14-38
 
 
Search WWH ::




Custom Search