Skip to main content

Dimension Loading Pattern

The Dimension Load Pattern is configured in the BimlFlex metadata in a Data Mart Project. This is a project where the Target Connection has an Integration Stage of Data Mart.

The Source Connection for the project can be a view, Staging Area object, or a Data Vault construct.

The Integration Key for the source object (the object(s) in the source connection) will be used for Dimension key lookups.

The target Dimension Object can be cloned from the Source Object. The target has an additional Sequence Identified (Identity Column) added as the Primary Key of the Dimension.

SSIS 'ETL' Implementation​

Dimension Load ETL Pattern for Type 1 Dimensions, implemented in the SSIS package

  1. SQL - Truncate target Data Mart Staging Table
  2. SQL - Check for initial load by checking if there is data in the target table
  3. SQL - Insert the Unknown and Not applicable rows that are not yet in the Dimension, for a dimension published from the Dimensional Accelerator with Add Unknown and Not applicable rows ticked (a date or time dimension made with Add date dimension or Add time dimension takes the two rows from its source view)
  4. DFT - Data Flow to Load Target Table
    1. SRC - Select from Source Object
    2. FLX - Row Count
    3. DC - Add Audit Columns
    4. FLX - Hash for Type 1 Attributes
    5. LKP - Lookup Surrogate Key
    6. DC - Derived Surrogate Defaults when needed
    7. DC - Insert Defaults if needed
    8. FLX - Row Count
    9. DST - Load Destination Staging Table, and Dimension Table at Initial Load
  5. SQL - Merge Staged data into Target Table for non-initial loads

Dimension Load ETL Pattern for Type 2 Dimensions, implemented in the SSIS package

  1. SQL - Truncate target Data Mart Staging Table
  2. SQL - Check for initial load by checking if there is data in the target table
  3. SQL - Insert the Unknown and Not applicable rows that are not yet in the Dimension, for a dimension published from the Dimensional Accelerator with Add Unknown and Not applicable rows ticked (a date or time dimension made with Add date dimension or Add time dimension takes the two rows from its source view)
  4. DFT - Data Flow to Load Target Table
    1. SRC - Select from Source Object
    2. FLX - Row Count
    3. DC - Add Audit Columns
    4. FLX - Hash for Type 1 Attributes
    5. FLX - Hash for Type 2 Attributes
    6. LKP - Lookup Surrogate Key
    7. DC - Derived Surrogate Defaults when needed
    8. CSPL - Split processing based on type of change (Type 1, Type 2, etc)
    9. DC - Insert/Update Defaults if needed, as per Change Type
    10. FLX - Row Count
    11. DST - Load Destination Staging Table, and Dimension Table at Initial Load
  5. SQL - Merge Staged data into Target Table for non-initial loads For a Type 2 change the merge sets RowIsCurrent to false on the current row and ends it one millisecond before the RowStartDate of the new row when RowStartDate is a DateTime2, or one day before when it is a Date

Dimension ELT Patterns​

The ELT Pattern is implemented in SQL and orchestrated through SSIS or ADF depending on the Integration Template of the Project.

The pattern for Type 1 Dimension loading, as implemented in a Stored Procedure, is as follows:

  1. Select into initial temporary Staging table Derive Attribute Hash as needed
  2. Insert the Unknown and Not applicable rows that are not yet in the target, for a dimension published from the Dimensional Accelerator with Add Unknown and Not applicable rows ticked (a date or time dimension made with Add date dimension or Add time dimension takes the two rows from its source view)
  3. Create Temporary 'Upsert' Table from Stage and Target
  4. Update any existing, changed rows
  5. Insert any new rows

The pattern for Type 2 Dimension loading, as implemented in a Stored Procedure, is as follows:

  1. Select into initial temporary Stage Derive Attribute Hash as needed for Type 1 and Type 2 column sets Derive Metadata as required
  2. Insert the Unknown and Not applicable rows that are not yet in the target, for a dimension published from the Dimensional Accelerator with Add Unknown and Not applicable rows ticked (a date or time dimension made with Add date dimension or Add time dimension takes the two rows from its source view)
  3. Insert new and Type 2 changed rows in target
  4. End Date any Type 2 changes The earlier row of each Integration Key takes the RowStartDate of the next row as its RowEndDate, so a row ends on the same value the next row starts on
  5. Create Temporary 'Upsert' Table from Stage and Target for Type 1 changes
  6. Update any existing, changed Type 1 Attributes