Adding the dimensional data to the data mart
Now that we have the refined model for our dimension, we can publish it to our data mart.
Let’s build the security dimension:
- Create the
DIM_SECURITY.sql
file in themodels/marts/portfolio
folder. - Enter the following code in the file:
SELECT * FROM {{ ref('REF_ABC_BANK_SECURITY_INFO') }}
As was the case for the position fact, we do not have special requirements now, so we are just publishing everything as it is in the REF model.
As usual, to deploy the model, run the following command:
dbt build -s DIM_SECURITY
And if you want to be sure that everything is deployed in the most recent form, run the following:
dbt build
After running one of the commands, you will have the two tables in the data mart, FACT_POSITION
and DIM_SECURITY
. You are now ready to start doing your analysis.