fact table the fact table stores business events. the attributes explain the conditions of the...

11
Designing the Dimensional Data

Upload: leslie-manning

Post on 21-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fact Table The fact table stores business events. The attributes explain the conditions of the entity at the time the business event happened

Designing the Dimensional Data

Page 2: Fact Table The fact table stores business events. The attributes explain the conditions of the entity at the time the business event happened

Fact TableThe fact table stores business events. The attributes explain the conditions of the

entity at the time the business event happened.

Page 3: Fact Table The fact table stores business events. The attributes explain the conditions of the entity at the time the business event happened

Dimension TableA dimension table is a table that contains :

Various attributes explaining the dimension key in the fact table.

The conditions of the entities involved in the business event stored in the fact table.

The attributes are stored as columns in the dimension tables.

They are known as dimensional attributes.

Page 4: Fact Table The fact table stores business events. The attributes explain the conditions of the entity at the time the business event happened

Dimension TableA dimension table is a table that contains

various attributes explaining the dimension key in the fact table.

Degenerate dimension : is a dimension with only one attribute, and therefore the attribute is put in the fact table.Identifier in the source system

Timestamp column: the time when the record was loaded into the fact tableWhen the fact row (or dimension row) was

loaded into data warehouse data store.

Page 5: Fact Table The fact table stores business events. The attributes explain the conditions of the entity at the time the business event happened

The users will be using the data warehouse to do analysis in six business areas: product sales, subscription sales, subscriber profitability, supplier performance, CRM campaign segmentation, and CRM campaign results.

Page 6: Fact Table The fact table stores business events. The attributes explain the conditions of the entity at the time the business event happened

Product SalesA product sales event happens when a customer

is buying a product, rather than subscribing to a package.

The roles (the who, where, and what) in this event are the customer, product, and store.

The levels (or in dimensional modeling terms, the measures) are the quantity, unit price, value, direct unit cost, and indirect unit cost.

Put the measures in the fact table and the roles (plus dates) in the dimension tables.

The business events become the fact table row.

Page 7: Fact Table The fact table stores business events. The attributes explain the conditions of the entity at the time the business event happened

Product Sales fact table and its dimensions

Page 8: Fact Table The fact table stores business events. The attributes explain the conditions of the entity at the time the business event happened

quantity, unit_price, and unit_cost measures are derived from the source system.

But other three measures (sales_value, sales_cost, and margin) are calculated.

They are defined as follows:sales_value = unit_price * quantisales_cost = unit_cost * quantitymargin = sales_value – sales_cost

The four keys in the Product Sales fact table link the fact table with the four dimensions.

Page 9: Fact Table The fact table stores business events. The attributes explain the conditions of the entity at the time the business event happened

GrainGrain is the smallest unit of occurrence of the

business event in which the event is measured.

In other words, grain is completing this sentence: “One row in the fact table corresponds to. . . .”

In this case, the grain is each item sold—one row in the Product Sales fact table corresponds to each item sold.

Simple measure: sales value, sales cost, margin

Page 10: Fact Table The fact table stores business events. The attributes explain the conditions of the entity at the time the business event happened

Product Sales table (and its dimensions) with timestamp columns

Page 11: Fact Table The fact table stores business events. The attributes explain the conditions of the entity at the time the business event happened