SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SCD Type 2 - EffectiveDate


SCD Type 2 - EffectiveDate

Author
Message
Lempster
Lempster
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5099 Visits: 1657
For an initial load of a new Data Warehouse, if the source systems do not store historical data, is it legitimate to populate the EffectiveDate column for Type 2 SCDs with the date that the initial load is run on?

Thanks
Lempster
xsevensinzx
xsevensinzx
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5113 Visits: 3128
I would like to know too.

In my system, I have the effective ETL load date that is used instead. That's only because if the source effective date is unknown, then my processes fail over to the last known effective date, the ETL load date.

I've been told that theory was sound, but would love to learn more.
sneumersky
sneumersky
Hall of Fame
Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)Hall of Fame (3.2K reputation)

Group: General Forum Members
Points: 3192 Visits: 487
I would use the most recent effective date from the source system, but also try to talk to the source system DBAs to make sure there is not an Audit database out there somewhere that could have some history/audit records.

Most importantly make sure the business stakeholders know the situation as soon as possible, and manage their expectations appropriately.
Lempster
Lempster
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5099 Visits: 1657
sneumersky (2/12/2014)
.... but also try to talk to the source system DBAs .....


If only there were some (or even one!). ;-)

I agree with your sentiment though.
sqlvogel
sqlvogel
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2104 Visits: 3708
If there is a foreign key referencing your table then consider whether it's important for the date/time of the referencing row to correspond to the date/time range of your effectivedate. If referential integrity within time periods is important to you then you need a strategy that supports that, e.g. populate the referencing rows and the parent rows with the same date ranges.
Lempster
Lempster
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5099 Visits: 1657
For this particular implementation, i can't think of a scenario where a column purely used to handle a type 2 SCD for a particular attribute would be referenced by a foreign key, but I understand what you're getting at.

Regards
Lempster
Bruce W Cassidy
Bruce W Cassidy
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3107 Visits: 1033
If any of your transactions reference a date prior to the effective date on the dimension, this could get somewhat confusing.

For an initial load, I generally use a "placeholder" date of "19000101". That way it's obvious that the date doesn't have any meaning other than ensuring that the dimension entry is valid prior to any facts referencing it.

Alternatively, you could work out what the first date each dimension entry is referenced, and use those as the effective dates. That can be a lot of work (depending on the size of your fact tables) though, so unless you have a business case for why that would be necessary, I would suggest that a placeholder would be easier.
Koen Verbeeck
Koen Verbeeck
SSC Guru
SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)SSC Guru (62K reputation)

Group: General Forum Members
Points: 62560 Visits: 13298
I use the placeholder as well.
Because you only just started recording history, the initial load is the representation of the "single version of facts" by the source system as it is known at that exact time.
You need to communicate clearly to the end users that all transaction data before the initial load is mapped to the initial view provided by the source system and that they need to take that into account when drawing conclusions.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Lempster
Lempster
SSCertifiable
SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)SSCertifiable (5.1K reputation)

Group: General Forum Members
Points: 5099 Visits: 1657
Thanls all. I think using a placeholder makes sense so that's what I'll do. Very much agree about setting user expectations!

Regards
Lempster
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search