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

Surrogate keys in dimension and fact table

2 posters

Go down

Surrogate keys in dimension and fact table Empty Surrogate keys in dimension and fact table

Post  in.bobj Tue Aug 23, 2011 7:20 am

Hell Gurus,

I am very much confused about this part of dimensional modelling.
If we use surrogate keys in our dimensional model, how we link the same with the fact table.
Because the surrogate key will be a sequence number generated with dimension table only.


For eg.
If I have created a dimension table customer with CUSTOMER_ID(natural key), Customer name.
and fact table ABC with columns as CUSTOMER_ID(foreign key) and REVENUE.
NOW if I create a surrogate key in dimension customer i.e. SID...How I will be able to link with fact table.

Can somebody help me understand.
I know the use of surrogate key in Slow changing dimension but not able to understand its link with fact table.


Thanks
in.bobj

in.bobj

Posts : 2
Join date : 2011-08-23

Back to top Go down

Surrogate keys in dimension and fact table Empty Re: Surrogate keys in dimension and fact table

Post  ngalemmo Tue Aug 23, 2011 10:44 am

You store the dimension's surrogate key as the FK in the fact table, not the customer ID.

To get the dimension's key, use the customer ID to locate the dimension row and retrive the key value from the row.
ngalemmo
ngalemmo

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

http://aginity.com

Back to top Go down

Surrogate keys in dimension and fact table Empty Thank you

Post  in.bobj Wed Aug 24, 2011 1:39 am

Thank You ngalemmo.

It clears a lot of doubts for me now.

in.bobj

Posts : 2
Join date : 2011-08-23

Back to top Go down

Surrogate keys in dimension and fact table Empty Re: Surrogate keys in dimension and fact table

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

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