Kimball Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Expiring rows in a SCD

2 posters

Go down

Expiring rows in a SCD Empty Expiring rows in a SCD

Post  gbritton Tue Dec 17, 2013 1:42 pm

Toy example for a real problem:

In the ETL i'm writing, I have a source table "foo". It is eventually loaded to dim.foo in the DW. "foo" has just two columns: "bar" and "fum". "bar" is my source business key.

Now, one of the changes that can happen in the source system is that a row in "foo" can be deleted, indicating that the data in column "fum" no longer applies to the key in column "bar". To detect this condition, I run a query that joins the new source data and my current dim table to find the now-absent rows. (There is no transaction data available to me to tell me that this has happened.) I will then mark these rows in my dim table as no longer active or relevant.

Question: Is this a reasonable approach? Is there a better way??

gbritton

Posts : 6
Join date : 2013-11-18

Back to top Go down

Expiring rows in a SCD Empty Re: Expiring rows in a SCD

Post  ngalemmo Tue Dec 17, 2013 1:53 pm

In a lot of cases there isn't a requirement to do this, but if you need to, what you describe is a reasonable way to do it. You never want to physically delete rows from a dimension.
ngalemmo
ngalemmo

Posts : 3000
Join date : 2009-05-15
Location : Los Angeles

http://aginity.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum