Database Reference
In-Depth Information
represented by the dimensions. For example, the
Sales
fact in Fig.
4.2
includes
the measures
Quantity
,
UnitPrice
,
Discount
,
SalesAmount
,
Freight
,and
Net-
Amount
. The identifier attributes of the levels involved in a fact indicate the
granularity of the measures, that is, the level of detail at which measures are
represented.
Measures are aggregated along dimensions when performing roll-up oper-
ations. As shown in Fig.
4.1
d, the aggregation function associated with
a measure can be specified next to the measure name, where the
SUM
aggregation function is assumed by default. In Chap.
3
, we classified measures
as
additive
,
semiadditive
,or
nonadditive
.AsshowninFig.
4.1
e, we
assume by default that measures are additive, that is, they can be summarized
along all dimensions. For semiadditive and nonadditive measures, we include
the symbols '+!' and '+', respectively. For example, in Fig.
4.2
the measures
Quantity
and
UnitPrice
are, respectively, additive and semiadditive measures.
Further, measures and level attributes may be
derived
,wheretheyare
calculated on the basis of other measures or attributes in the schema. We use
the symbol '/' for indicating derived measures and attributes. For example,
in Fig.
4.2
, the measure
NetAmount
is derived.
A
hierarchy
comprises several related levels, as in Fig.
4.1
b. Given two
related levels of a hierarchy, the lower level is called the
child
and the higher
level is called the
parent
. Thus, the relationships composing hierarchies
are called
parent-child relationships
.The
cardinalities
in parent-child
relationships, as shown in Fig.
4.1
c, indicate the minimum and the maximum
number of members in one level that can be related to a member in another
level. For example, in Fig.
4.2
, the child level
Product
is related to the
parent level
Category
with a one-to-many cardinality, which means that every
product belongs to only one category and that each category can have many
products.
A dimension may contain several hierarchies, each one expressing a par-
ticular criterion used for analysis purposes; thus, we include the
hierarchy
name
(Fig.
4.1
f) to differentiate them. If a single level contains attributes
forming a hierarchy, such as the attributes
City
,
Region
,and
Country
in the
Employee
dimension in Fig.
4.2
, this means that the user is not interested in
employing this hierarchy for aggregation purposes.
Levels in a hierarchy are used to analyze data at various
granularities
or
levels of detail. For example, the
Product
level contains specific information
about products, while the
Category
level may be used to see these products
from the more general perspective of the categories to which they belong. The
level in a hierarchy that contains the most detailed data is called the
leaf
level
. The name of the leaf level defines the dimension name, except for the
case where the same level participates several times in a fact, in which case
the role name defines the dimension name. These are called
role-playing
dimensions
. The level in a hierarchy representing the most general data is
called the
root level
. It is usual (but not mandatory) to represent the root
of a hierarchy using a distinguished level called
All
, which contains a single
Search WWH ::
Custom Search