Recording why a change happened using MERGE with Type 2 SCD

  • I have a few fields in my staging DimProducts that are type 2 scd. I've got my merge statement up and run after a little bit of confusion.

    Is it possible/necessary to track why a scd occurred or should we just be concerned with the audit trail i.e.

    "these are the old records for this product, this is the new active record, they old ones could have been retired for three reasons,but i don't care why they just did!!!"

    I was originally included the three status in my dim (product active, color active, size active) and it was confusing me as the merge wasn't updating them as i expected.

    Thanks.

  • I'm not sure how you define "why something changed". That sounds more like a business rule.

  • Do you mean why something changed from a business perspective or from a logical perspective? Using Lookup and Conditional Split transforms it's quite easy to track whether column values have been Inserted, Updated or Deleted and then you could populate a 'ReasonForChange' column accordingly. If it's the business reason for change that you want to capture, that would likely need to come from the source system, otherwise you'd just be guessing I'd have thought.

    Regards

    Lempster

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply