Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Incremental fact update concept


Incremental fact update concept

Author
Message
blackholl20
blackholl20
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 130
Hi,

My source table is Transactions, which has ID, Value and Date, It reflects history of transactions.
My fact holds transactions time frame, each row has ID, Value, StartDate and EndDate.

The incremental process takes the delta transactions.

In first run Transactions table is:
Transactions: ID: 1, Value: 500, Date: 2012-08-01
The incremental process takes this single row to staging and copy to fact:
Fact: ID: 1, Value: 500, StartDate: 2012-08-01, EndDate: NULL

In second run Transactions table is:
Transactions: ID: 1, Value: 500, Date: 2012-08-01
Transactions: ID: 1, Value: 600, Date: 2012-08-02

The incremental process takes the second row to staging and copy this row to the fact:
Fact: ID: 1, Value: 500, StartDate: 2012-08-01, EndDate: NULL
Fact: ID: 1, Value: 600, StartDate: 2012-08-02, EndDate: NULL

BUT the EndDate of the first row should be update as well:
Fact: ID: 1, Value: 500, StartDate: 2012-08-01, EndDate: 2012-08-02
Fact: ID: 1, Value: 600, StartDate: 2012-08-02, EndDate: NULL

Now, the question is:
Should all FACT retro change rows (those records that exist in FACT but not in the incremental delta records but still needs to get update in FACT) get into STAGING table first (extract), get update (transform), and then to return to FACT (load)? If yes - should it get from source table or from FACT table?
Should this update should be done directly on the FACT (update previous row EndDate with next row StartDate)?

Thanks in advance!
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