Hi Kiwi,
First in the dimension tables we will generate surrogate keys . In the dimension tables we will have surrogate keys and natural keys.
We will load the data into fact tables from source system. But from the source we will have only natural keys only. We need to use lookup to the dimensional table natural keys with source data fields and get the surrogate and load . We can use the join also to get the surrogate keys especially if dimension if SCD type2 . In this case for one natural key we will get more surrogate key values.
Let me explain with example .
Product Dimension table .
Product Key ( Surrogate key),Product ID(SKU Number), Product Name, Shelf NO
1,101,butter,201
2,102,milk,301
3,101,butter,202
Here 101 product changed the shelf but surrogate key is primary key here . Product ID is natural key here . Here I want to load the data into fact table from source data(transaction table), we need to join with dimension table on product ID of the source and product ID of the dimension and get the surrogate key and load into target .
Thanks & Regards,
Ramana.