Creating fact tables
Now that we've created all the dimensions, it is time to create a fact table that contains numeric values and the primary keys of the dimensions as foreign keys. Looking at the Sales Base
and Customer Base
data shows us that the Sales Base
table holds many transactions with numeric values. Therefore, a fact table can be derived from the Sales Base
table, which we will call Sales
, by following these steps:
- Reference the
Sales Base
table and then rename the new tableSales
.We want to get
ProductKey
from theProduct
table. To do so, we can merge theSales
table with theProduct
table. - Click Merge Queries.
- Select the
ProductCategory
,ProductSubcategory
, andProduct
columns, respectively. - Select the
Product
table from the dropdown list. - Again, select the
ProductCategory
,ProductSubcategory
, andProduct
columns. - Select Left outer (all from first, matching from second) from the Join Kind dropdown list.
- Click OK: