Database Reference
In-Depth Information
Figure 14-4. Setting the default measure in a cube
Using Key vs. Name Identifiers
To identify an individual member, you can use either a key or a name. To use a key, insert a numeric value that
represents the member's location within that dimensional level. In other words, if we have a Titles dimension,
it might include not only titles but also the publishers. If so, the publisher as well as the titles will each have
a dimensional level. The key value of 1 on the publisher's level indicates the first member of that level. In the
PubsSales cube, the first member of the publishers level is New Moon Books.
We can also use the publisher name instead of its key value. Listing 14-8 shows both examples. Notice that a
key value is indicated by using the symbol “&” in front of the number.
Listing 14-8. Examples Using the Key vs. Name Identifiers
Select
{ [Measures].[SalesQuantity] } On Columns,
{ −- Dimension - Hierarchy - Level - Member by Key
[DimTitles].[TitlesByPublisher].[Publisher].&[1] -- Using Key
} On Rows
From [CubePubsSales];
-- Same result, but uses the Name of the attribute and not the key
Select
{ [Measures].[SalesQuantity] } On Columns,
{ −- Dimension - Hierarchy - Level - Member by Name
[DimTitles].[TitlesByPublisher].[Publisher].[New Moon Books] -- Using Name
} On Rows
From [CubePubsSales];
 
 
Search WWH ::




Custom Search