0% found this document useful (0 votes)
28 views14 pages

DWT Chapter 2 Part 2

Uploaded by

Debanjali Nath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views14 pages

DWT Chapter 2 Part 2

Uploaded by

Debanjali Nath
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14

CHAPTER 2 PART 2

SLOWLY CHANGING DIMENSION


ATTRIBUTES
• Dimension attributes are sometimes static, but often
change over time
• Slowly changing attributes might be something like a
change in a product. The sales fact table might
contain a key to a dimension table with data about
the color of the product. If the color of the product is
changed in the future, we will need to decide how to
handle that change in the respective dimension table
• There are 8 different methodologies; Type 0 through
Type 7
SCD TYPES

• Type 0: Retain Original


• The dimension attribute does not change. The original data is
retained, and only new fact rows will refer to the changed
dimension
SCD TYPES

• Type 1: Overwrite
• Old attribute values are overwritten with the new value
• This destroys history, but makes aggregation of data easier
for reports
SCD TYPES

• Type 2: Add New Row


• A new row is added in the dimension table so that the old
and new values are represented
• Requires at least 3 new columns (row effective date/time,
row expiration date/time, current row indicator
SCD TYPES

• Type 3: Add New Attribute


• Adds a new attribute to preserve the old attribute
• New value overwrites the main attribute
• Used infrequently
SCD TYPES

• Type 4: Add Mini-Dimension


• The mini-dimension only applies to the attribute which
needs to be changed, and is not an entire new row
• Requires its own unique primary key
SCD TYPES

• Type 5: Add Mini-dimension and Type 1


Outrigger
• Preserves historical attribute values, and report
historical facts according to current attribute values
• Like the Type 4 mini-dimension, but also adds a type 1
reference to the mini-dimension in the base dimension
SCD TYPES
SCD TYPES

• Type 6: Add Type 1 Attributes to Type 2


Dimension
• Adds a new row like type 2 but embeds a type 1
overwrite so that reports can see the history while also
seeing when the change took place
SCD TYPES

• Type 7: Dual Type 1 and Type 2 Dimensions


• Both a durable key and surrogate key for the two types
is placed in the fact table allowing reports to return the
type 1 overwrite, or type 2 new row changes. Allows
for both as-was and as-is reporting
ADVANCED FACT TABLE TECHNIQUES

• Fact table surrogate keys


• We have discussed surrogate keys in dimension tables
• Used in fact tables to:
• A single column primary key
• Serve as an intermediate identifier of a fact table row for ETL process
• Allow interrupted load process to either back out or resume
• Allow facts table update operations to be decomposed into less risky
inserts plus deletes
• Numeric Values as Attributes or Facts
• Where does a product’s standard list price belong? In a fact or
dimension table?
ADVANCED DIMENSION TECHNIQUES

• Dimension-to-Dimension Table Joins


• Dimensions can contain references to other dimensions
• Multivalued Dimensions and Bridge Tables
• Generally, each dimension attached to a fact table has a single
value consistent with the fact table’s grain
• There are several situations where a dimensions is legitimately
multivalued
• When a fact table row needs to connect to multiple different
dimension values, a bridge table is used. A group dimension key is
recorded in the fact table, which corresponds to a bridge table row
consisting of multiple different dimension table attributes!
WHAT QUESTIONS CAN I ANSWER?

You might also like