[Solved] ROW_IS_CURRENT

View previous topic View next topic Go down

[Solved] ROW_IS_CURRENT

Post  exhortae on Tue Jan 29, 2013 9:56 am

Hi,


Why do we need a ROW_IS_CURRENT column in a dimension.


Thanks.


Last edited by exhortae on Wed Jan 30, 2013 5:25 am; edited 1 time in total

exhortae

Posts : 30
Join date : 2010-08-01

View user profile

Back to top Go down

Re: [Solved] ROW_IS_CURRENT

Post  BoxesAndLines on Tue Jan 29, 2013 9:59 am

To easily identify the current row in a type 2 SCD.
avatar
BoxesAndLines

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

View user profile

Back to top Go down

Re: [Solved] ROW_IS_CURRENT

Post  exhortae on Tue Jan 29, 2013 10:43 am

BoxesAndLines wrote:To easily identify the current row in a type 2 SCD.

For what purpose ?

* In a lookup to easily retrieve the primary key in a dimension ?
* When building reports ?
* ... ?

exhortae

Posts : 30
Join date : 2010-08-01

View user profile

Back to top Go down

Re: [Solved] ROW_IS_CURRENT

Post  TheNJDevil on Tue Jan 29, 2013 11:12 am

I think if you understood what a Type 2 SCD was in more detail, you would see the need for ROW_IS_CURRENT.

* In a lookup to easily retrieve the primary key in a dimension ? YES
* When building reports ? YES

Basically, anytime you need to separate the current record from the change record history.

TheNJDevil

Posts : 68
Join date : 2011-03-01

View user profile

Back to top Go down

Re: [Solved] ROW_IS_CURRENT

Post  BoxesAndLines on Tue Jan 29, 2013 11:41 am

Assume I have a credit status code in my type 2 customer dimension. Now, tell me the current credit status of all customers.

Select * from customer_dim where current_row_ind = 'Y'

or

Select * from customer_dim where row_end_dt = '12/31/9999'

Two ways to skin the cat.
avatar
BoxesAndLines

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

View user profile

Back to top Go down

Re: [Solved] ROW_IS_CURRENT

Post  exhortae on Wed Jan 30, 2013 5:25 am

BoxesAndLines wrote:
Select * from customer_dim where row_end_dt = '12/31/9999'


I always used this one, I tought row_is_current might bring something else.

Thanks

exhortae

Posts : 30
Join date : 2010-08-01

View user profile

Back to top Go down

Re: [Solved] ROW_IS_CURRENT

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