Database Reference
In-Depth Information
As we will see in Chap. 6 , MDX has several operators that specifically
operate over the time dimension. To support these operators, we need to tell
Mondrian which attributes define the subdivision of the time periods to which
the level corresponds. We indicate this with the attribute levelType in the
Attribute element. Values for this attribute can be TimeYears , TimeHalfYears ,
TimeQuarters , TimeMonths ,andsoon.
We give next examples of attribute definition of the Product dimension:
< Attribute name= ' Unit Price ' caption= ' Prix Unitaire '
1
description= ' Le prix unitaire de ce produit ' keyColumn= ' UnitPrice ' / >
2
< Attribute name= ' Product Name ' caption= ' Nom du Produit '
3
description= ' Le nom de ce produit ' keyColumn= ' ProductName ' / >
4
The example shows three properties of the Attribute element. A caption is to
be displayed on the screen to a user, whereas the name is intended to be used
in code, particularly in an MDX statement. Usually, the name and caption
are the same, although the caption can be localized (shown in the language
of the user, as in the example) while the name is the same in all languages.
Finally, a description is displayed in many user interfaces (such as Pentaho
Analyzer) as tooltips when the mouse is moved over an element. Name,
caption, and description are not unique to attributes; the other elements
that may appear on user's screen also have them, including Schema , Cube ,
Measure ,and Dimension .
Mondrian implicitly creates attribute hierarchies ,evenifahierarchyis
not defined explicitly for the attribute. For example, if in dimension Employee
an attribute is defined as follows:
< Attributes >
1
< Attribute name= ' Last Name ' keyColumn= ' LastName ' / >
2
...
3
< /Attributes >
4
this is interpreted as if the following hierarchy has been defined in the
dimension:
< Hierarchy name= ' Last Name ' >
1
< Level attribute= ' Last Name ' / >
2
< /Hierarchy >
3
When a schema has more than one cube, these cubes may have several
dimensions in common. If these dimensions have the same definitions, they are
declared once and can be used in as many cubes as needed. In Mondrian, these
are called shared dimensions . Further, we have seen that dimensions can
be used more than once in the same cube. In the Northwind cube, the Time
dimension is used three times to represent the order, due, and shipped dates
of orders. We have seen that these are called role-playing dimensions .
Search WWH ::




Custom Search