Types of dimensions:
·
Role playing Dimension
·
Conformed Dimension
·
Junk Dimension
·
Degenerate Dimension
·
Slowly Changing Dimension
·
Rapidly changing Dimension
·
Inferred Dimension
1. Role playing Dimension:
When dimension table is having more
than FK relationship with Fact table is called Role playing
dimension.
Ex: SaleDateKey and DeliveryDateKey
2. Conformed Dimension:
·
A conformed dimension relates to multiple fact
tables within the same DWH.
·
DimDate is a common conformed dimension because its attributes
(day, week, month, quarter, year, etc) have the same meaning when joined to any
fact table.
·
Ex: Calendar (Here meaning is changing so it’s not conformed
dimension means Financial year starts with Apr so its first month of FY and
Normal year starts with Jan so it’s the first month of normal calendar. So here
meaning is changing so it’s not Conformed Dimension)
Normal Calendar |
Financial Calendar |
Jan 1 Q1 Feb 2 Mar 3 …. Dec 12 |
Apr
1 Q1 May 2 June 3 ….. Mar 12 |
3. Junk Dimension: *****Vimp
·
Junk dimensions are used to reduce the number of
dimensions in the dimensional model.
·
And reduce the number of columns in the fact table.
·
It will help us to reduce size of the fact table.
4. Degenerate Dimension:
·
The term “degenerate dimension” was originated by Ralph Kimball.
·
Degenerate dimension describes a dimension field in the fact table
that doesn’t have a corresponding
dimension table.
·
Placing these text attribute will slowdown the performance of Fact
tables.
·
Ex: Voucher number, Bill number etc
Note: Check above example for Degenerate dimension.
5. Slowly Changing Dimension (SCD):
·
In Data Warehouse there is a need to track changes in dimension
attributes in order to report historical data.
· Slowly changing dimensions are used when we wish to capture the changing data within the dimension over time.
-
Note:
Whenever
we implement slowly changing dimension (SCD) tables. PK will not be implemented
we have to create a new key which is called surrogate key as we need to keep
historical data.
- We do not
have the Surrogate key in OLTP, we only have the surrogate key
in OLAP in few tables only.
6. Rapidly Changing Dimensions:
·
This cannot be implemented at all in DWH.
Ex. Share market
·
We cannot keep such type of data in DWH which is changing in every
minute
7. Inferred Dimensions:
·
Inferred Dimensions are called Late Arriving Dimensions
·
Early arriving Facts, Late arriving dimensions
ð For some reason if the data in Dimension table did not come
first and fact data comes first it is called inferred dimensions. But
while inserting in fact table you will get error when checking the PK/FK
reference.
ð So removing a FK from fact table is the first solution in
such cases. And second solution is you keep dummy value in dimension table
and insert the values in fact tables.
How do you load the data in DWH?
Ans: First Load Data in Dim tables (Step1) and later Load data in Fact tables (Step2)