lecture 4
lecture 4
(IS 422)
Lecture 4
Dimensional modeling
Dr. Wael Abbas
2023 - 2024
slides in this file from the following book Sharda, Ramesh, Dursun Delen, and Efraim Turban. Business intelligence,
analytics, and data science: a managerial perspective. pearson, 2018.
Data modeling
• The Elements of Data Model
Dimensional model life cycle:
1. Gathering Requirements (Source Driven, Business/User Driven).
• Periodic has less detail, with one row covering an entire time period. For
example, rather than showing every transaction in your banking account, it
shows one row related to the end of month or end of period balance.
• Finally, the least-detailed grain and fewest rows is the one where you’re
accumulating facts. For example, you placed an order, and all the dates
related to the order data are requested, filled, shipped, etc., and all placed on
the same record. That record is updated and in place.
Fact Types
There are three types of fact tables in dimensional modeling:
1. Transaction fact
2. Periodic fact
3. Accumulating fact
Fact Types
1. Transaction fact tables are the most common in dimensional modeling.
They record a business event or transaction, one record at a time, with all
the data associated with the event. An example is a sales transaction, such
as the purchase of a book on Amazon. The purchase is recorded in the
transaction fact table for sales.
An example of this, using an internet sales order, is where you record the
first event, the order, then you record subsequent dates and events such as
when the order was placed, when a credit card transaction was processed,
when the order was shipped, various states during the shipping, then finally
when it is delivered to the customer.
These are called role-playing date dimensions with events referred to in our
example as the order date, ship date, and delivered date.
Fact Types
3. Accumulating fact tables
Characteristics of accumulating fact :-
1. An accumulating fact table stores one row for the entire process.
2. Accumulating Fact tables does not accumulate time it accumulates business
process.
3. A row in an accumulating snapshot fact table summarizes the measurement events
occurring at predictable steps between the beginning and the end of a process
4. Accumulating Fact tables are used to show the activity of progress through a well-
defined process and are most often used to research the time between milestones.
5. These fact tables are updated as the business process unfolds, and each milestone is
happen
completed.
Fact Types
3. Accumulating fact tables
Claim_key 21000
Customer_key 2001
Claim_date 2023-10-31
inspect_date 2023-11-1
Day_to_inspect 1
Review_date 2023-11-4
Day_to_review 4
Decision_date 2023-11-6
Day_to_decision 6
Process_complete_flag 0
Fact Types
Fact Types
Measures types
• There are types of measures: additive, semiadditive, nonadditive ,derived,
and textual fact.
1. Additive Facts
An additive fact is the easiest to define and manage. It’s simply a measure of
the fact table that can be added across all dimensions. The simplest example
of an additive fact is the quantity of items you bought in an online store—such
as the number of books. Additive measures enable the fact to be aggregated by
all applicable dimensions, which in our example is customer, store, product,
Sales_fact
and date.
Date_key
Customer_id
Store_id
Product_id
Sales_amount
Measures types
2. Semi_additive Facts
Semi additive facts are measurements in the fact table that can be added across
some dimensions but not others. For example , retrieving the account balance
for each account each day does not give us any useful information .
Sales_fact
Date_key
account
Account_balance
Measures types
3. non_additive Facts
Nonadditive facts are measures in fact tables that can’t be added across any
dimensions. Non-additive facts are usually the result of ratios (percentage) or
other mathematical calculations. even though they are numbers they aren’t
supposed to be added.
Sales_fact
Date_key
account
Profit_Margin
Measures types
4. Derived Facts
Derived facts are created by performing a mathematical calculation