---
title: Formula Integrity Check
description: Validates whether calculated or derived values in a dataset correctly follow expected formula-based logic (e.g., totals, derived fields). Ensures consistency and accuracy in computed fields.
group: Accuracy
---

# Formula Integrity Check

The **Formula Integrity Check** ensures that computed or derived values in a dataset are accurate by validating them against predefined formula expressions.  
This rule is commonly used to:

- Validate calculated financial totals like `OrderAmount = Quantity × UnitPrice`
- Verify that derived KPIs or metrics follow expected business rules

**Example Usage**:  
Ensure `OrderAmount` in an e-commerce orders table equals `Quantity × UnitPrice` for every transaction.

---

## Configuration Fields

### Rule-Specific Configuration

| Field Name           | Description                                                      | Required | Data Type / Options                                   |
|:--------------------|:-----------------------------------------------------------------|:-----------|:------------------------------------------------------|
| **Formula Expression** | Logical/mathematical expression for validation (e.g. `A + B`)    | Yes       | String                                               |
| **Operator**           | Comparison operator for evaluating formula result               | Yes       | `Equals`, `Not Equals`, `Greater Than`, `Less Than`, `Greater Than or Equals`, `Less Than or Equals` |

---

### Success Criteria Configuration

This section defines how the rule’s outcome is measured against expected thresholds.

| Field Name        | Description                                                 | Required | Options / Format                                                             |
|:-----------------|:------------------------------------------------------------|:-----------|:-----------------------------------------------------------------------------|
| **Operator**        | Comparison operation for result count                       | Yes       | `GreaterThan`, `LessThan`, `EqualTo`, `Between`                              |
| **Threshold Value** | Value for comparison (single value for most operators)      | Conditional| Number                                                                      |
| **Threshold Min**   | Minimum value (for `Between` operator)                      | Conditional| Number                                                                      |
| **Threshold Max**   | Maximum value (for `Between` operator)                      | Conditional| Number                                                                      |
| **Is Percentage**   | Whether threshold represents a percentage or absolute count| No        | `true` / `false` (default: `false`)                                         |

---

## Sample Input Data

| OrderID | Quantity | UnitPrice | OrderAmount |
|:----------|:-----------|:------------|:--------------|
| 1        | 2         | 500        | 1000         |
| 2        | 3         | 450        | 1400         |
| 3        | 5         | 200        | 1000         |
| 4        | 1         | 700        | 700          |
| 5        | 4         | 250        | 1000         |

---

## Sample Configurations

### Example 1: **Check OrderAmount Calculation Accuracy**



| Configuration Field     | Value                        |
|:-------------------------|:------------------------------|
| Column                    | OrderAmount                    |
| Formula Expression         | Quantity * UnitPrice           |
| Operator                   | Equals                          |
| Success Criteria Operator  | GreaterThan                     |
| Threshold Value            | 80                              |
| Is Percentage              | true                            |

**Explanation**:  
Checks whether `OrderAmount` equals `Quantity × UnitPrice` in each row. Rule passes if at least 80% of records match the formula.

---

## Sample Output

| Column Name | Rule Name               | Success Count | Failure Count | Null Count | Within Threshold |
|:--------------|:--------------------------|:---------------|:---------------|:------------|:----------------|
| OrderAmount    | Formula Integrity Check    | 4               | 1               | 0          | Yes              |

---

