Creating fact tables
Now that we have 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. The Sales Base and Customer Base data show that the Sales Base table holds many numeric values. Therefore, a fact table can be derived from the Sales Base table, which we name Sales, by following these steps:
- Reference the Sales Base table and then rename the new table Sales.
We want to get ProductKey from the Product table. To do so, we can merge the Sales table with the Product table.
- Click Merge Queries.
- Select the ProductCategory, ProductSubcategory, and Product columns, respectively.
- Select the Product table from the drop-down list.
- Again, select the ProductCategory, ProductSubcategory, and Product columns.
- Select Left outer (all from first, matching from second) from the Join Kind drop-down list.
- Click OK:
Figure 6.37:...