Multiple Life cycle entities in One dimension table...

View previous topic View next topic Go down

Multiple Life cycle entities in One dimension table...

Post  VTK on Wed Jan 25, 2012 8:11 pm

When we have more than one life cycle attributes in a dimension table, how do we track Type-2 on that table ?

Say, we have an agent dimension table and we have agent start and end dates, agent agreement start and end dates.
Now, agreement start and end date can change, agent's start and end date can change and there may be other fields in the table which can cause a new version to be created.

when we come to this table to get a key during the fact population what date range should we use ?
if we use any one life cycle dates then there may be multiple records for it because of change in other...
We can't use the Type-2 Row Effective dates as we would also have future dated records in this table. How do we solve this issue ?

Appreciate your time...

Thanks

VTK

Posts : 50
Join date : 2011-07-15

View user profile

Back to top Go down

Re: Multiple Life cycle entities in One dimension table...

Post  ngalemmo on Thu Jan 26, 2012 12:03 am

In a basic type 2, the row that the fact references is the current dimension row at the time the fact was loaded. It doesn't matter what dates are on the row.

From that there have been variations to the basic load strategy, including choosing dimension rows based on some date. Normally, this is used when you need to deal with late arriving facts.
avatar
ngalemmo

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

View user profile http://aginity.com

Back to top Go down

Re: Multiple Life cycle entities in One dimension table...

Post  VTK on Thu Jan 26, 2012 12:23 am

Thanks for the reply but the question here is how do you choose the right dimension record during the fact load ?
I don't think it's late arriving fact situation rahter soon arriving dimension...As I said before, I can't use row effective dates as there will be future dated record. for ex., there will be a record whose business effectiveness will start in 2015 but we received the record now itself and that will be shown as current record in the dimension table which is wrong....

Let me know if I did not explain the problem properly...

VTK

Posts : 50
Join date : 2011-07-15

View user profile

Back to top Go down

Re: Multiple Life cycle entities in One dimension table...

Post  ngalemmo on Thu Jan 26, 2012 1:08 am

In a normal situation, reference the current version of that dimension row at the time you are loading the row in the fact table. Usually you update the dimension table first.

In reporting you can use whichever version of the dimension you need by performing a self join on the dimension using the natural key and a predicate on whichever date range you wish.
avatar
ngalemmo

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

View user profile http://aginity.com

Back to top Go down

Re: Multiple Life cycle entities in One dimension table...

Post  hang on Thu Jan 26, 2012 7:05 am

I think none of your business dates, agent and agreement start/end dates should influence the SCD dates that would be set based on new dimension NK and attribute change. Treat the business dates like other attributes based on appropriate SCD types. If you allow the agent to start or end multiple times, then these business dates are SCD 2, otherwise SCD 1.

When you load your fact, if the dimension NK appears in the fact, you should load the dimension record based on SCD dates, or current indicator, unless it's late arriving dimension, in which case, you create a new dimension record with the NK as a place holder. The business dates are only used in your queries and reports, not in ETL.

hang

Posts : 528
Join date : 2010-05-07
Location : Brisbane, Australia

View user profile

Back to top Go down

Re: Multiple Life cycle entities in One dimension table...

Post  BoxesAndLines on Thu Jan 26, 2012 10:39 am

kaps wrote:Thanks for the reply but the question here is how do you choose the right dimension record during the fact load ?
I don't think it's late arriving fact situation rahter soon arriving dimension...As I said before, I can't use row effective dates as there will be future dated record. for ex., there will be a record whose business effectiveness will start in 2015 but we received the record now itself and that will be shown as current record in the dimension table which is wrong....

Let me know if I did not explain the problem properly...

Why would a row with a future effective date be the current record? Most people do not load future records in their dimensions. When they say current, it means the active record, which normally is the most recently inserted. If you load future records, then current means the active record, not the most recent. And that should be defined by row effective and end dates.
avatar
BoxesAndLines

Posts : 1212
Join date : 2009-02-03
Location : USA

View user profile

Back to top Go down

Re: Multiple Life cycle entities in One dimension table...

Post  VTK on Fri Jan 27, 2012 12:13 am

I think I did not explain the scenario properly. Let me give the example...

Code:

Surr Key   Natural Key   Col1   Status   Bus Start Date   Bus End Dt   Row Eff Dt    Row End Dt
1   100               xyz   Status1   1/10/2011   1/1/2012               1/10/11 12:00 AM    1/14/11 12:00 AM
2   100               xyz1   Status1   1/10/2011   2/11/2012   1/15/11 12:00 AM    2/11/11 12:00 AM
3   100               xyz1   Status2   2/12/2011   1/1/2015     2/12/11 9:00 AM    2/12/11 10:00 AM
4   100               xyz1   Status3   2/12/2011   1/1/2015               2/12/11 10:01 AM    2/15/11 10:00 AM
5   100               xyz2   Status3   2/12/2011   1/1/2015               2/15/11 10:01 AM    12/31/99 12:00 AM

I want to find a dim for the fact record which happened on 2/13/2012. If I use Row Eff dates then I would get 4 which is wrong as it's not effective now. I should have gotten 3. If I use Bus dates then I would get both 4 & 5 and then we have to use more logic to narrow it down and it can get more complicated when one more set of start and end dates.

One solution is to omit future records in the dimension then we need to pick it up when it's ready to be picked upůso was wondering about what others did in this scenario.

Thanks

VTK

Posts : 50
Join date : 2011-07-15

View user profile

Back to top Go down

Re: Multiple Life cycle entities in One dimension table...

Post  LAndrews on Fri Jan 27, 2012 2:19 pm



If you use row effective dates, then for a given date (e.g. 2/13/2012), each natural key should have 1 effective row.

In your example, it looks like there are issues with the row effective dates - there are gaps with no effective row due to the time aspect. Also, if your row effective dates are datetime fields, then you'll need to establish an ETL rule to determine what time you will use when performing your lookup.

For example, rather than looking for 2/13/2012, you need to look at 2/13/2012 12:00am.


LAndrews

Posts : 132
Join date : 2010-05-13
Location : British Columbia, Canada

View user profile

Back to top Go down

Re: Multiple Life cycle entities in One dimension table...

Post  ngalemmo on Fri Jan 27, 2012 6:31 pm

You assign row #5, the current one. Add a current flag to your table to make it easier to find.

Why are three different statuses in effect at the same time?
avatar
ngalemmo

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

View user profile http://aginity.com

Back to top Go down

Re: Multiple Life cycle entities in One dimension table...

Post  VTK on Sun Jan 29, 2012 2:13 pm

Ngaalemmo

It's my bad. I messed up the examples...Here you go...

Code:

Surr Key  Natural Key      Col1    Status  Bus Start Date  Bus End Dt  Row Eff Dt    Row End Dt
1        100      xyz    Status1  1/10/2011     1/14/2011      1/10/11      1/14/11
2        100      xyz1  Status1  1/15/2011     2/11/2011      1/15/11        2/11/11
3        100      xyz1  Status2  2/12/2011     1/1/2015        2/12/11        2/12/11
4        100      xyz1  Status3  1/2/2015     12/31/9999      2/13/11        2/15/11
5        100      xyz2  Status3  1/2/2015     12/31/9999      2/15/11        12/31/99

On 2/15/2012, I should get Row#3 but in this case(If row eff dates used) then I would get Row#5 which is not correct.

VTK

Posts : 50
Join date : 2011-07-15

View user profile

Back to top Go down

Re: Multiple Life cycle entities in One dimension table...

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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