Now that we have loaded the master data tables that form the data vault model, we can now load the transaction tables.
We manage the transaction tables in the RAW layer.
The transaction tables contain some useful attributes that describe the measures, but the majority of attributes will come from the master data tables. This means we need to add a key to each transaction record to link to the corresponding master data record.
Flowgraphs in the RAW Data Warehouse also load the tables via synonyms. In our example there is no need to take the transaction tables through a staging layer, as we did for the master data tables, because the transaction tables are already complete.
To integrate the transaction data into the model, we need to include the surrogate keys from each of the hub tables so that we can join the master data to each transaction record. In our example we will include only the CUSTOMER, PRODUCT, and STORE master data. Additionally, new columns with the load date time-stamp and the source are added to the transaction tables to provide useful audit data.
The nodes in our flowgraph to load one of the transaction tables are as follows:
- data source - this node points to our synonym which in turn points to the transaction table (actuals) in the external schema
- projection - ensure we only generate distinct rows (non duplicated)
- data source - this is the customer hub table that provides the surrogate key
- data source - this is the product hub table that provides the surrogate key
- data source - this is the store hub table that provides the surrogate key
- join - fetch the surrogate key from each hub table and add all three of them to the transaction record - these keys will be used later to join to the master data tables
- table comparison - ensure the record does not already exist it the target table
- data target - update the transaction table with the new records
Launch the video to watch how we load one of the transaction tables using a flowgraph:
We have already loaded the plan table CE2IDEA using a similar flowgraph.