Question

A customer is changing the address let say 5 times.

How to implement CUSTOMER dimension using slowly changing dimension type 3?

Was it helpful?

Solution 2

Well! I don't like to paste links in answers, but I think, answer is lengthy one and SCD Type 3 already has number of implementation examples available. See the following links:

Implementing SCD Type 3 with SSIS

and

SCD Type 3 using SSIS

OTHER TIPS

Well the customer is changing the address at least 5 times. I don't think this is a good idea to track changes with SCD Type-3,(because it is not a slow changing dimension it comes under the category of rapidly changing dimensions well thats another topic but i must say you should look at it.) it means you are going to add at least 5 columns in your customer table, I am not good with Math. but i guess if you have 100 record in you db, you are adding 5 columns and each column length is 200 character, you are going to grow your table 200*5*100 byte considering a character is of 1 byte. And this is the rare case, other 99 customers have 5 columns added for free. The best way to keep track of it is via SCD Type-2 change. I am sure you know how to do that with SCD Type-2 Now how to do this with SCD Type-3

Step 1: Add another column old_address Step 2: rename previous address column to address_n Step 3: update the affected customer data (old_address = address_n WHERE KEY = You_Customer_Key) Step 4: Update the address_n with new address

For 5 time address changes keep iterating this 5 times. in address_n the n is your iteration.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top