---
title: Reduce the volume of the Cleansing Error tables
description: Up to Generator 1.9, the cleansing actions of a Dimensional project log each row of an Entity or Fact whose foreign key is NULL or has no match.
---

[Skip to content](https://knowledge.bigenius-x.com/reduce-the-volume-of-the-cleansing-error-tables#main-content)

[Contact us](https://knowledge.bigenius-x.com/kb-tickets/new?hsLang=en) [Go to Customer Portal](https://knowledge.bigenius-x.com/customer-portal?hsLang=en)

[![TRI\_Logo\_biGENIUS\_2020\_RGB\_s](https://knowledge.bigenius-x.com/hs-fs/hubfs/Marketing/TRI_Logo_biGENIUS_2020_RGB_s.png?width=150&height=42&name=TRI_Logo_biGENIUS_2020_RGB_s.png)](https://www.bigenius-x.com/)

Open main navigation

Close main navigation

- [Contact us](https://knowledge.bigenius-x.com/kb-tickets/new)
- [Go to Customer Portal](https://knowledge.bigenius-x.com/customer-portal)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [biGENIUS-X Knowledge Base](https://knowledge.bigenius-x.com/?hsLang=en)
2. [Best practices](https://knowledge.bigenius-x.com/best-practices?hsLang=en)
3. [Use Cases](https://knowledge.bigenius-x.com/best-practices?hsLang=en#use-cases)

# Reduce the volume of the Cleansing Error tables

**Applies to**  
Platform: Microsoft SQL Server  
Architecture: Dimensional

Up to Generator 1.9, the cleansing actions of a Dimensional project log each row of an Entity or Fact whose foreign key is NULL or has no match in the referenced Entity. When a NULL foreign key is a valid case in your source, point it to an N/A row of your own in the referenced Entity. These rows then load without log entries, and real missing keys are still logged.

This article applies to projects with Generator 1.9 or earlier. Since Generator 1.10, data quality rules replace the cleansing actions; see [Reduce the volume of the Data Quality rules log](https://knowledge.bigenius-x.com/reduce-the-volume-of-the-data-quality-rules-log?hsLang=en).

### How missing foreign keys are logged

For each relationship of an Entity or Fact, a cleansing action looks up the foreign key in the business keys of the referenced Entity. For each row without a match, it writes a row whose description starts with `Missing foreign key value for relation to "<referenced Entity>"` to the cleanse error table of the dataflow:

- Entity: `CLS_EN_<entity name>_<dataflow name>_Error`
- Fact: `CLS_F_<fact name>_<dataflow name>_Error`

See [Take care of entries from Cleansing Error tables](https://knowledge.bigenius-x.com/take-care-of-entries-from-cleansing-error-tables?hsLang=en).

### Point NULL foreign keys to your own row

1. Choose a surrogate key and a business key for the N/A row that the source never delivers, for example `-10` for both.
2. Open **Manage Term Mappings** of the model object that has the relationship. Set the **Expression** of the foreign key term so that NULL becomes the business key of the N/A row, see the [example](https://knowledge.bigenius-x.com/reduce-the-volume-of-the-cleansing-error-tables#example).
3. Generate the artifacts and deploy them.
4. Insert the N/A row into the table of the referenced Entity. Take the column list from the `CREATE TABLE` statement of the Entity in the generated artifacts.
5. Load the project. The rows with a NULL foreign key now point to the N/A row, and the cleanse error table has no rows for them.

The N/A row is not part of the generated artifacts. Up to Generator 1.9, each deployment recreates the tables and removes the row. Keep the `INSERT` statement as a script and run it after each deployment.

### Example

The Entity `Product_Product` has a relationship to the Entity `Product_Subcategory`. Products without a subcategory deliver NULL in `ProductSubcategoryID`. The foreign key term `FK_Product_Subcategory_ProductSubcategoryID` of `Product_Product` gets this expression:

```
CASE
    WHEN s1.ProductSubcategoryID IS NULL THEN -10
    ELSE s1.ProductSubcategoryID
END
```

After the deployment, this script adds the N/A row to `Product_Subcategory`. In the script, `DW` stands for the schema of the Core layer:

```
SET IDENTITY_INSERT [DW].[COR_EN_Product_Subcategory] ON;
GO
INSERT INTO [DW].[COR_EN_Product_Subcategory] (
     [BG_SourceSystem]
    ,[BG_LoadTimestamp]
    ,[BG_UpdateTimestamp]
    ,[Product_Subcategory_ID]
    ,[ProductSubcategoryID]
    ,[FK_Product_Category_ProductCategoryID]
    ,[Product_Category_Product_Category_ID]
    ,[Name]
)
VALUES (
     'N/A'
    ,CONVERT(DATETIME, '19000101', 112)
    ,CONVERT(DATETIME, '19000101', 112)
    ,-10
    ,-10
    ,0
    ,0
    ,'Not available'
);
GO
SET IDENTITY_INSERT [DW].[COR_EN_Product_Subcategory] OFF;
GO
```

### Check the result

After the load, the products without a subcategory point to the N/A row, and the cleanse error table of `Product_Product` has no row with the description `Missing foreign key value for relation to "Product_Subcategory"` for them. Rows whose foreign key has another value without a match are still logged.

### Related articles

- See also: [Reduce the volume of the Data Quality rules log](https://knowledge.bigenius-x.com/reduce-the-volume-of-the-data-quality-rules-log?hsLang=en), [Take care of entries from Cleansing Error tables](https://knowledge.bigenius-x.com/take-care-of-entries-from-cleansing-error-tables?hsLang=en)

- [Getting started](https://knowledge.bigenius-x.com/getting-started?hsLang=en#main-content)

    - [Guidelines](https://knowledge.bigenius-x.com/getting-started?hsLang=en#guidelines)
    - [Start working](https://knowledge.bigenius-x.com/getting-started?hsLang=en#start-working)
    - [Account](https://knowledge.bigenius-x.com/getting-started?hsLang=en#account)
- [General overview](https://knowledge.bigenius-x.com/general-overview?hsLang=en)
- [Artificial Intelligence](https://knowledge.bigenius-x.com/artificial-intelligence?hsLang=en#main-content)

    - [MCP server](https://knowledge.bigenius-x.com/artificial-intelligence?hsLang=en#mcp-server)
- [Application Modules](https://knowledge.bigenius-x.com/application-modules?hsLang=en#main-content)

    - [Administration](https://knowledge.bigenius-x.com/application-modules?hsLang=en#administration)
    - [Solutions](https://knowledge.bigenius-x.com/application-modules?hsLang=en#solutions)
    - [Global Features](https://knowledge.bigenius-x.com/application-modules?hsLang=en#global-features)
    - [Projects](https://knowledge.bigenius-x.com/application-modules?hsLang=en#projects)
    - [Branches](https://knowledge.bigenius-x.com/application-modules?hsLang=en#branches)
    - [Data Connections](https://knowledge.bigenius-x.com/application-modules?hsLang=en#data-connections)
    - [Dataflow Modeling - Overview](https://knowledge.bigenius-x.com/application-modules?hsLang=en#dataflow-modeling-overview)
    - [Dataflow Modeling - Wizard Steps](https://knowledge.bigenius-x.com/application-modules?hsLang=en#dataflow-modeling-wizard-steps)
    - [Dataflow Modeling - Terms](https://knowledge.bigenius-x.com/application-modules?hsLang=en#dataflow-modeling-terms)
    - [Dataflow Modeling - Term Mapping](https://knowledge.bigenius-x.com/application-modules?hsLang=en#dataflow-modeling-term-mapping)
    - [Dataflow Modeling - Relationships](https://knowledge.bigenius-x.com/application-modules?hsLang=en#dataflow-modeling-relationships)
    - [Dataflow Modeling - Data Quality](https://knowledge.bigenius-x.com/application-modules?hsLang=en#dataflow-modeling-data-quality)
    - [Dataflow Modeling - Indexes](https://knowledge.bigenius-x.com/application-modules?hsLang=en#dataflow-modeling-indexes)
    - [Relationship Modeling](https://knowledge.bigenius-x.com/application-modules?hsLang=en#relationship-modeling)
    - [Generate Artifacts](https://knowledge.bigenius-x.com/application-modules?hsLang=en#generate-artifacts)
    - [Project Settings](https://knowledge.bigenius-x.com/application-modules?hsLang=en#project-settings)
    - [Data Marketplace](https://knowledge.bigenius-x.com/application-modules?hsLang=en#data-marketplace)
- [Generators](https://knowledge.bigenius-x.com/generators?hsLang=en#main-content)

    - [Databricks](https://knowledge.bigenius-x.com/generators?hsLang=en#databricks)
    - [Databricks dbt](https://knowledge.bigenius-x.com/generators?hsLang=en#databricks-dbt)
    - [Fabric Lakehouse](https://knowledge.bigenius-x.com/generators?hsLang=en#fabric-lakehouse)
    - [Fabric Warehouse](https://knowledge.bigenius-x.com/generators?hsLang=en#fabric-warehouse)
    - [Microsoft SQL Server](https://knowledge.bigenius-x.com/generators?hsLang=en#microsoft-sql-server)
    - [Oracle](https://knowledge.bigenius-x.com/generators?hsLang=en#oracle)
    - [Snowflake](https://knowledge.bigenius-x.com/generators?hsLang=en#snowflake)
    - [Snowflake dbt](https://knowledge.bigenius-x.com/generators?hsLang=en#snowflake-dbt)
    - [Artifacts](https://knowledge.bigenius-x.com/generators?hsLang=en#artifacts)
    - [Replace Placeholders](https://knowledge.bigenius-x.com/generators?hsLang=en#replace-placeholders)
    - [Target solution environment](https://knowledge.bigenius-x.com/generators?hsLang=en#target-solution-environment)
    - [Deployment](https://knowledge.bigenius-x.com/generators?hsLang=en#deployment)
    - [Deployment with an Azure DevOps pipeline](https://knowledge.bigenius-x.com/generators?hsLang=en#deployment-with-an-azure-devops-pipeline)
    - [Delta Deployment](https://knowledge.bigenius-x.com/generators?hsLang=en#delta-deployment)
    - [Load control environment](https://knowledge.bigenius-x.com/generators?hsLang=en#load-control-environment)
    - [Load data with a native load control](https://knowledge.bigenius-x.com/generators?hsLang=en#load-data-with-a-native-load-control)
    - [Load data with Apache Airflow](https://knowledge.bigenius-x.com/generators?hsLang=en#load-data-with-apache-airflow)
    - [Model Object Type](https://knowledge.bigenius-x.com/generators?hsLang=en#model-object-type)
    - [Properties](https://knowledge.bigenius-x.com/generators?hsLang=en#properties)
    - [Default Terms](https://knowledge.bigenius-x.com/generators?hsLang=en#default-terms)
- [Discovery application](https://knowledge.bigenius-x.com/discovery-application?hsLang=en#main-content)

    - [Discovery configurations](https://knowledge.bigenius-x.com/discovery-application?hsLang=en#discovery-configurations)
- [Best practices](https://knowledge.bigenius-x.com/best-practices?hsLang=en#main-content)

    - [Modeling Approaches](https://knowledge.bigenius-x.com/best-practices?hsLang=en#modeling-approaches)
    - [Use Cases](https://knowledge.bigenius-x.com/best-practices?hsLang=en#use-cases)
    - [Business Rules](https://knowledge.bigenius-x.com/best-practices?hsLang=en#business-rules)
    - [Data Quality Rules](https://knowledge.bigenius-x.com/best-practices?hsLang=en#data-quality-rules)
- [FAQs](https://knowledge.bigenius-x.com/faqs?hsLang=en)
- [Product Release Notes](https://knowledge.bigenius-x.com/product-release-notes?hsLang=en#main-content)

    - [SaaS Application](https://knowledge.bigenius-x.com/product-release-notes?hsLang=en#saas-application)
    - [Discovery application](https://knowledge.bigenius-x.com/product-release-notes?hsLang=en#discovery-application)
    - [Generators](https://knowledge.bigenius-x.com/product-release-notes?hsLang=en#generators)
    - [MCP server](https://knowledge.bigenius-x.com/product-release-notes?hsLang=en#mcp-server)
- [Legal Documents](https://knowledge.bigenius-x.com/legal-documents?hsLang=en#main-content)

    - [Current legal docs](https://knowledge.bigenius-x.com/legal-documents?hsLang=en#current-legal-docs)
    - [Software Product and Limits](https://knowledge.bigenius-x.com/legal-documents?hsLang=en#software-product-and-limits)

- [Contact us](https://knowledge.bigenius-x.com/kb-tickets/new?hsLang=en)
- [Customer Portal](https://knowledge.bigenius-x.com/customer-portal)
- [Sign in](https://knowledge.bigenius-x.com/_hcms/mem/login)

[![biGENIUS logo](https://knowledge.bigenius-x.com/hubfs/TRI_Logo_biGENIUS_2020_RGB-1.svg "biGENIUS logo")](https://www.bigenius-x.com)

<https://www.linkedin.com/company/bigenius> <https://www.youtube.com/@biGENIUS_DWA>

All rights reserved © 2025, biGENIUS AG