Database Reference
In-Depth Information
values for the
hideMemberIf
attribute are
Never
(the member always appears,
the default value) and
IfParentName
(the member appears unless its name
matches the one of its parent).
We next show how a
fact
(or
degenerate
)
dimension
can be defined in
Mondrian. Such a dimension has no associated dimension table, and thus,
all the columns in the dimension are in the fact table. In the case of the
Northwind cube, there is a fact dimension
Order
, composed by the order
number and the order line number corresponding to the fact. To represent
this dimension, we may write:
<
Dimension name=
'
Order
'
table=
'
Sales
'
>
1
<
Attributes
>
2
<
Attribute name=
'
Order No
'
keyColumn=
'
OrderNo
'
>
3
<
Attribute name=
'
Order Line
'
keyColumn=
'
OrderLine
'
>
4
<
/Attributes
>
5
<
/Dimension
>
6
Note that the table associated with the dimension is the
Sales
fact table.
5.10.3 Measures
As in Analysis Services, in Mondrian the measures are also considered
dimensions: every cube has an implicit
Measures
dimension (we will see this
in detail in Chap.
6
). The
Measures
dimension has a single hierarchy, also
called
Measures
, which has a single level, in turn also called
Measures
.The
measures of the
Sales
cube are defined as follows:
<
Cube name=
'
Sales
'
>
1
<
Dimensions . . . /
>
2
<
MeasureGroups
>
3
<
MeasureGroup name=
'
Sales
'
table=
'
Sales
'
>
4
<
Measures
>
5
<
Measure name=
'
Unit Price
'
column=
'
UnitPrice
'
6
aggregator=
'
avg
'
formatString=
'
$#,##0.00
'
/
>
7
<
Measure name=
'
Sales Count
'
aggregator=
'
count
'
/
>
8
...
9
<
/Measures
>
10
<
DimensionLinks
>
11
<
ForeignKeyLink dimension=
'
Customer
'
12
foreignKeyColumn=
'
CustomerKey
'
/
>
13
<
ForeignKeyLink dimension=
'
OrderDate
'
14
foreignKeyColumn=
'
OrderDateKey
'
/
>
15
...
16
<
FactLink dimension=
'
Order
'
/
>
17
<
/DimensionLinks
>
18
<
/MeasureGroup
>
19
<
/MeasureGroups
>
20
<
CalculatedMember name=
'
Net Amount
'
dimension=
'
Measures
'
21
formula=
'
[Measures].[Sales Amount]-[Measures].[Freight]
'
>
22
Search WWH ::
Custom Search