Skip to content
  • There are no suggestions because the search field is empty.

Mart Fact

Applies to
Platform: Microsoft SQL Server · Snowflake · Databricks · Databricks dbt · Fabric Lakehouse · Fabric Warehouse · Oracle
Architecture: Data Mart

A Mart Fact loads measures into a table of the Mart layer and replaces the business key of each referenced Mart Dimension by its surrogate key. Use it for transactions and events that you analyze along Mart Dimensions. After a load, each row holds the surrogate key of the dimension version that was valid at the row's BG_EffectiveTimestamp.

Sources and relationships

A Mart Fact reads these sources, in one or more dataflows:

  • Data Mart: Mart Composite and Mart Hierarchy Flatten of the project, and linked objects of a Data Vault, Dimensional (Entity, Fact) or Data Store project (Store Entity).
  • Vault and Mart: the Raw Vault and Business Vault objects of the project except the composites, Vault Out, Mart Composite and Mart Hierarchy Flatten.
  • Dimensional and Mart (not on Databricks dbt and Oracle): Entity, Fact, Mart Composite, Mart Hierarchy Flatten and linked Store Entity.

A Mart Fact references at least one Mart Dimension through a relationship with a role. The relationship adds a foreign key term for each business key term of the Mart Dimension. You map them to the source columns that hold the business key. A Mart Out can read a Mart Fact.

Create a Mart Fact

Business keys are optional on a Mart Fact, and the table has no primary key. Deduplication Method Partition uses the business keys to keep one row per key.

Dimension lookup

The lookup view joins the result view of each referenced Mart Dimension on the foreign key terms:

  • With BG_EffectiveTimestamp mapped, a row gets the version of a historized Mart Dimension whose BG_ValidFromTimestamp is at or before the effective timestamp and whose BG_ValidToTimestamp is after it. The lookup reads both from the result view, so it works with the project property Persist Validity on or off.
  • Without a mapping of BG_EffectiveTimestamp, the lookup uses the current time and assigns the current version of a historized Mart Dimension. Validation reports the warning Relations will be resolved to the latest version in related model object.
  • A row without a matching dimension version gets the surrogate key -1, the unknown-member row of the Mart Dimension. This applies to an unknown business key, an empty foreign key and an effective timestamp before the first version. Custom Singleton Values sets the values of that row.

Properties

  • Fact Load Strategy, per dataflow: Truncate Insert (default) or Insert. With Insert and no mapping of BG_IncrementalFilter, every load inserts all source rows again, and validation reports a warning. With a mapping, Insert appends only the increment, and Truncate Insert also loads only the increment, except on Databricks dbt. Both values on one dataflow need the two loaders in separate execution plans. On Databricks dbt, select one value.

With Fact Load Strategy Truncate Insert on more than one dataflow, each dataflow's loader empties the table, so the table keeps only the rows of the dataflow loaded last. Use Insert when several dataflows load the same Mart Fact.

Default Terms

Generated objects

The part flow of Mart Fact shows which parts it can get and under which settings; the legend explains the symbols. Its lookup view is named _Lkp (_Lookup in the diagram).

Part flow of Mart Fact, top to bottom. The main path on the left, with the default settings, runs _Source, Table, _Result. Decisions with their values, the default or main value first: Deduplication Method (None; Distinct, Partition); Fact Load Strategy (Truncate Insert; Insert); Create Result Views (true; false); BG_IncrementalFilter (mapped); Increment Management Type (Auto; User: request ID). Detours add the other parts: _Lookup, _TruncateInsertLoader, _InsertLoader, _Deduplication, _Increment, _IncrementSource.

These are the names on Microsoft SQL Server for a Mart Fact sales with one dataflow.

RoleGenerated namePurposeGenerated when
SourceDM_MF_sales_SourceJoins and maps the sourcesAlways
DeduplicationDM_MF_sales_DeduplicationRemoves duplicate rowsDeduplication Method Distinct or Partition
IncrementSourceDM_MF_sales_IncrementSourceFinds the new incrementBG_IncrementalFilter mapped, Increment Management Type Auto
IncrementDM_MF_sales_IncrementStores the incrementsBG_IncrementalFilter mapped
LookupDM_MF_sales_LkpFinds the surrogate keysAlways
LoaderDM_MF_sales_TruncateInsertLoaderLoads the tableFact Load Strategy Truncate Insert
LoaderDM_MF_sales_InsertLoaderInserts the new rowsFact Load Strategy Insert
StorageDM_MF_salesFact tableAlways
ResultDM_MF_sales_ResultQuery viewCreate Result Views true

Generated parts of model objects shows the order in which a load runs the parts and the settings that add or remove them.

Example

The Mart Fact sales on Microsoft SQL Server reads the Business Current View SALESTRANSACTION. It references the Mart Dimension employee with the role cashier, so its surrogate key term is employee_cashier_SK. The foreign key term FK_employee_cashier_EMPLOYEE_ID is mapped to CASHIER_ID, and BG_EffectiveTimestamp to TRANSACTION_TIME. The Fact Load Strategy is Truncate Insert.

The Mart Dimension holds two versions of employee 1: surrogate key 1 from 2026-01-01 to 2026-03-01 and surrogate key 2 from 2026-03-01. The source delivers these transactions:

TRANSACTION_ID  CASHIER_ID  TRANSACTION_TIME  QUANTITY
101             1           2025-12-31 12:00  1.000
102             1           2026-01-01 00:00  2.000
103             1           2026-02-28 12:00  3.000
104             1           2026-03-01 00:00  4.000
105             99          2026-03-15 12:00  5.000
106             NULL        2026-03-16 12:00  6.000

Check the result

After the load on 2026-10-28 at 10:00, query the result view, here in the schema mart:

SELECT TRANSACTION_ID, employee_cashier_SK, QUANTITY,
       BG_LoadTimestamp
FROM mart.DM_MF_sales_Result
ORDER BY TRANSACTION_ID;

This is the result, with a shortened column name and timestamp:

TRANSACTION_ID  SK  QUANTITY  LoadTs
101             -1  1.000     2026-10-28 10:00
102             1   2.000     2026-10-28 10:00
103             1   3.000     2026-10-28 10:00
104             2   4.000     2026-10-28 10:00
105             -1  5.000     2026-10-28 10:00
106             -1  6.000     2026-10-28 10:00
  • Transaction 102 happened exactly at the start of version 1 and gets surrogate key 1. Transaction 104 happened exactly at the start of version 2 and gets surrogate key 2.
  • Transaction 101 happened before the first version, so it references the unknown-member row -1.
  • Cashier 99 does not exist and transaction 106 has no cashier, so both reference -1 as well.
  • A repeated load empties the table and inserts the six rows again with the new load timestamp.

Platform differences

The rules for names, loaders, deployment, platform properties and defaults are in Model object types on each platform. The Mart Fact differs from them in these points:

  • Snowflake: the load control task LC_DM_MF_<model object name>_TRUNCATEINSERTTASK or LC_DM_MF_<model object name>_INSERTTASK calls the loader.
  • Databricks dbt: the table model does the lookup. The table model uses the materialization bg_overwrite for Truncate Insert and bg_append for Insert. With both values, it uses bg_overwrite, and Insert is ignored. With more than one dataflow, each dataflow gets its own loader model.

Limitations

  • A Mart Fact has at least one relationship to a Mart Dimension, and every foreign key term must be mapped.
  • An aggregation must be defined in all dataflow sets or in none.

Release differences

  • Generator 2.0: Foreign Key Mode is available.
  • Generator 2.2: Increment Management Type and the terms BG_LowerThreshold, BG_UpperThreshold and BG_IncrementLoadStatus are available. Databricks dbt is available.
  • Generator 2.4: Non-Historized Satellite and Non-Historized Business Satellite can be sources.

Related articles