Develop ETL Support for Incremental Load of Facts

This page provides information on how to add support for incremental load of a Fact in the ETL process.

It is assumed that an existing Fact is the target, i.e. SSIS packages for load of the Stage, Dw and Dm areas already exist.

Contents

Modifications Related to Configuration

Make sure to add the following information in the file dbo.SSIS_PACKAGE_CONFIGInsertStmts.sql in component APTOOL for the fact source identity that should support incremental load.

Column Name Column Value Note
supports_incremental_load 1 Value=1 means that true incremental load is supported. For all other set Value=0
incr_load_date_col_name MVT_CREATED_DT The name of the column in the snapshot (MVT) table that keeps the created datetime for each record. Normally the name is MVT_CREATED_DT but could be something else.
last_max_incr_load_dt NULL Always supply NULL. This column will be updated during the ETL process.
suggested_incr_stmt WHERE MVT_CREATED_DATE > &LAST_MAX_INCR_LOAD_DT This is the suggested WHERE statement to be used when loading incrementally from IFS Applications

Stage Related Modifications 

Handle New Columns

The incremental snapshot source table in IFS Applications will have at least one or even two new columns to consider in the stage step.

  1. Created Snapshot Date

    The column name is given by attribute incr_load_date_col_name in the configuration table. In most cases the column name is MVT_CREATED_DT. The data type should be datetime.

    1. Make sure to add the column to the corresponding stage table.
    2. If the source also supports Demo data, add the column to the stage demo data tables
    3. Make sure to handle the column in the SSIS Stage packages, both for ordinary data and demo data
  2. Unique Identity

    A unique fact identifier may have been added during development of Incremental Load. The suggested name is ID but could also be OBJID.

    1. Make sure to add the column to the corresponding stage table.
    2. If the source also supports Demo data, add the column to the stage demo data tables
    3. Make sure to handle the column in the SSIS Stage packages, both for ordinary data and demo data

      Note: Use this Fact attribute/column instead of building it in the SSIS packages as an additional column.

     

SSIS-New Variable XConfLastMaxIncrLoadDtStr

Note: Only applies to the standard stage SSIS package. No modifications related to Demo data.

Add a new string variable named XConfLastMaxIncrLoadDtStr. The purpose with the variable is to store the value of the last saved max created timestamp of transactions transferred from IFS Applications database to the data warehouse for the current source.

SSIS-Modify Get Configuration Settings Task

Note: Only applies to the standard stage SSIS package. No modifications related to Demo data.

The Execute SQL task that gets configuration settings should be updated to select the current value the column Last_Max_Incr_Load_Dt_Str from the configuration table for the current source.

Dw Related Modifications

Handle New Columns

The incremental snapshot source table in IFS Applications will have at least one or even two new columns to consider in the Dw step.

  1. Created Snapshot Date

    The column name is given by attribute incr_load_date_col_name in the configuration table. In most cases the column name is MVT_CREATED_DT. The data type should be datetime.

    1. Make sure to add the column to the corresponding Dw table.
    2. If the source also supports Demo data, add the column to the Dw demo data table
    3. Make sure to handle the column in the SSIS Dw packages, both for ordinary data and demo data
  2. Unique Identity

    A unique fact identifier may have been added during development of Incremental Load. The suggested name is ID but could also be OBJID.

    1. Make sure to add the column to the corresponding Dw table.
    2. If the source also supports Demo data, add the column to the Dw demo data table
    3. Make sure to handle the column in the SSIS Dw packages, both for ordinary data and demo data

      Note: Use this Fact attribute/column instead of building it in the SSIS packages as an additional column.

Other

No other modifications are necessary. Just make sure that the SSIS packages still are working and that transactions are correctly transferred from the Stage table(s) to the Dw tables(s). Also make sure that the columns representing Created Snapshot Data and Unique Identity have been successfully transferred.

Dm Related Modifications

Handle New Columns

The incremental snapshot source table in IFS Applications will have at least one or even two new columns to consider in the Dm step.

  1. Created Snapshot Date

    The column name is given by attribute incr_load_date_col_name in the configuration table. In most cases the column name is MVT_CREATED_DT. The data type should be datetime.

    1. Make sure to add the column to the corresponding Dm table.
    2. If the source also supports Demo data, add the column to the Dm demo data table
    3. Make sure to handle the column in the SSIS Dm packages, both for ordinary data and demo data
  2. Unique Identity

    A unique fact identifier may have been added during development of Incremental Load. The suggested name is ID but could also be OBJID.

    1. Make sure to add the column to the corresponding Dm table.
    2. If the source also supports Demo data, add the column to the Dm demo data table
    3. Make sure to handle the column in the SSIS Dw packages, both for ordinary data and demo data

      Note: Use this Fact attribute/column instead of building it in the SSIS packages as an additional column.


SSIS-New Variable XMaxCreatedDt

Note: Only applies to the standard stage SSIS package. No modifications related to Demo data.

Add a new DateTime variable named XMaxCreatedDt. The purpose with the variable is to store the value of the max created timestamp of transactions, in the current execution, transferred from the data warehouse to the data mart for the current source.

SSIS-Modify Data Flow

Use an existing SSIS package that supports incremental load as a template. Select the Script Component and then just copy it in to the target Dm SSIS package.

SSIS-Modify Control Flow

Testing