Surrogate keys in dimension and fact table
2 posters
Page 1 of 1
Surrogate keys in dimension and fact table
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
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
Re: Surrogate keys in dimension and fact table
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.
To get the dimension's key, use the customer ID to locate the dimension row and retrive the key value from the row.
Thank you
Thank You ngalemmo.
It clears a lot of doubts for me now.
It clears a lot of doubts for me now.
in.bobj- Posts : 2
Join date : 2011-08-23
Similar topics
» Two level keys from Hierarchhy Dimension into Fact table
» Surrogate Keys in ODS and Dimension
» Resetting Dimension Surrogate Keys
» Surrogate keys and Dimension-to-Dimension links
» Business keys or Natural keys in the Fact table
» Surrogate Keys in ODS and Dimension
» Resetting Dimension Surrogate Keys
» Surrogate keys and Dimension-to-Dimension links
» Business keys or Natural keys in the Fact table
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum