Database Reference
In-Depth Information
in MDX queries; also written as (0) and (1) . Columns are position 0 , and rows are position 1 . Although some
developers prefer to use words, many prefer to write the MDX code using the numeric identifier instead.
Listing 14-10 shows the three different styles used to identify the positions.
Listing 14-10. Identifying Axis Positions Within Queries
Select
{ [Measures].[SalesQuantity] } On Columns,
{ [DimTitles].[TitlesByType].[TitleType] } On Rows
From [CubePubsSales];
-- Same as...
Select
{ [Measures].[SalesQuantity] } On Axis(0), -- Using Axis Key
{ [DimTitles].[TitlesByType].[TitleType] } On Axis(1)
From [CubePubsSales];
-- Note that the Axis collection uses Parentheses (like VB)
-- and not Brackets (like C#)
-- same as before, but does not use the Axis keyword
Select
{ [Measures].[SalesQuantity] } On 0, -- Using Axis Key
{ [DimTitles].[TitlesByType].[TitleType] } On 1
From [CubePubsSales];
It is worth noting that you cannot skip a position in your MDX code. While some client applications allow
you to display the results across columns and across rows, the MDX code must specify 0 before 1 . Position 0
cannot be skipped. Listing 14-11 shows an example of this.
Listing 14-11. Positions Cannot be Skipped in Columns and Rows
-- This WILL NOT work, because we are not including the 0 axis
Select
{ [DimTitles].[TitlesByType].[TitleType] } On 1
From [CubePubsSales];
--ERROR="Axis numbers specified in a query must be sequentially specified, and cannot contain
gaps."
-- Must be written as ...
Select
{ [DimTitles].[TitlesByType].[TitleType] } On 0
From [CubePubsSales];
Cells and Tuples
Microsoft's help pages define a tuple with the following statement: “A tuple uniquely identifies a slice of data
from a cube.” Perhaps the best way to think of a tuple is a single result from an MDX query. Understanding the
difference between cells and tuples can be confusing, because cells contain a single value and tuples are a single
 
Search WWH ::




Custom Search