Date post: | 20-Jun-2015 |
Category: |
Documents |
Upload: | claudia-gomez |
View: | 163 times |
Download: | 4 times |
DATA WAREHOUSING Multi Dimensional Data Modeling Hierarchies and Levels
2
3
customer custId name address city
53 joe 10 main sfo
81 fred 12 main sfo
111 sally 80 willow la
product prodId name price
p1 bolt 10
p2 nut 5
store storeId city
c1 nyc
c2 sfo
c3 la
sale oderId date custId prodId storeId qty amt
o100 1/7/97 53 p1 c1 1 12
o102 2/7/97 53 p2 c1 2 11
105 3/8/97 111 p1 c3 5 50
3
Group data within dimensions: SalesRep
Region
▪ SubRegion ▪ Country
Customer
4 4
Hierarchies are logical structures that use ordered levels as a means of organizing data.
For a particular level value, a value at the next higher level is its parent, and values at the next lower level are its children
5 5
Hierarchies impose a family structure on dimension values. For a particular level value, a value at the next higher level is its parent, and values at the next lower level are its children.
These familial relationships enable analysts to access data quickly.
6 6
A dimension can be composed of more than one hierarchy.
7
time day week month quarter year
1 1 1 1 2000
2 1 1 1 2000
3 1 1 1 2000
4 1 1 1 2000
5 1 1 1 2000
6 1 1 1 2000
7 1 1 1 2000
8 2 1 1 2000
days
weeks months
weeks
years
quarters
months
7
Query tools use hierarchies to enable you to drill down into your data to view different levels of granularity.
This is one of the key benefits of a data warehouse.
8 8
When designing hierarchies, you must consider the relationships in business structures. For example, a divisional multilevel sales organization.
9 9
A level represents a position in a hierarchy. For example, a time dimension might have a hierarchy that represents data at the month, quarter, and year levels.
Within a hierarchy, each level is logically connected to the levels above and below it.
time day week month quarter year
1 1 1 1 2000
2 1 1 1 2000
3 1 1 1 2000
4 1 1 1 2000
5 1 1 1 2000
6 1 1 1 2000
7 1 1 1 2000
8 2 1 1 2000
years
quarters
months
10
The levels in a dimension are organized into one or more hierarchies.
months
weeks
years
quarters
months
11
Levels range from general to specific, with the root level as the highest or most general level.
all
years
quarters
months
days
weeks
12
Level relationships specify top-to-bottom ordering of levels from most general (the root) to most specific information.
They define the parent-child relationship between the levels in a hierarchy.
13
store storeId cityId tId mgr
s5 sfo t1 joe
s7 sfo t2 fred
s9 la t1 nancycity cityId pop regId
sfo 1M north
la 5M south
region regId name
north cold region
south warm region
sType tId size location
t1 small downtown
t2 large suburbs
store city region
14
The Data Warehouse Toolkit.Second Edition.The Complete Guide to Dimensional Modeling.Ralph Kimball.Margy Ross