> For the complete documentation index, see [llms.txt](https://docs.tricloudnexus.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tricloudnexus.io/management-portal/oee/equipment/tag-mapping/data-quality.md).

# Data Quality

Provide any two of three counts — Total, Approved, Rejected — and the OEE engine derives the third.

The **Data Quality** group of Tag Mapping drives the Quality pillar. The engine needs only **two** of three unit counts; the third is computed automatically:

| Provided pair       | Derivation                    |
| ------------------- | ----------------------------- |
| Total + Rejected    | `Approved = Total − Rejected` |
| Total + Approved    | `Rejected = Total − Approved` |
| Approved + Rejected | `Total = Approved + Rejected` |

You pick the pair that matches what your equipment actually emits — this is by far the most common cause of confusion when configuring Quality, so choose deliberately.

***

## Quality calculation

The **Quality calculation** dropdown selects which two counts you’ll provide. The fields below it adapt to the choice.

| Option                                             | Fields shown                                                   | Use when                                                                                                  |
| -------------------------------------------------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| **Total Products & Rejected Products** *(default)* | Products total *(required)*, Products rejected *(required)*    | The PLC reports a single "produced" counter and a separate "rejected" counter. Most common configuration. |
| **Total Products & Approved Products**             | Products total *(required)*, Products approved *(required)*    | The PLC counts produced units and good units; rejects are derived as Total − Approved.                    |
| **Approved Products & Rejected Products**          | Products approved *(required)*, Products rejected *(required)* | The PLC counts good and bad units separately and never emits the total — the engine sums them.            |

***

## The three counts

Each count is a numeric tag — typically an Accumulating counter — wired through the standard Select Tag Mapping dialog. See [Tag Mapping](/management-portal/oee/equipment/tag-mapping.md#single-tag-direct-vs-accumulating) for when to use **Accumulating** vs. **Direct**.

| Field                 | Visible when                                                   | Required             | Notes                                                                                                                      |
| --------------------- | -------------------------------------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| **Products total**    | Quality calculation = Total & Rejected, or Total & Approved    | Yes (in those modes) | The total number of units produced (good + rejected). For Accumulating counters, set the Roll Over Value if the tag wraps. |
| **Products approved** | Quality calculation = Total & Approved, or Approved & Rejected | Yes (in those modes) | The number of units that passed quality control.                                                                           |
| **Products rejected** | Quality calculation = Total & Rejected, or Approved & Rejected | Yes (in those modes) | The number of units that were rejected, scrapped, or sent for rework.                                                      |

{% hint style="info" %}
In the default **Total & Rejected** mode, the **Products approved** field is hidden because Approved is derived as `Total − Rejected`. The third (derived) count is hidden in each mode — only the two inputs you’ve picked are shown, and both are required to save the configuration.
{% endhint %}

{% hint style="warning" %}
Each emission of **Products total**, **Products approved**, and **Products rejected** must carry a timestamp **identical** to the order-completion event’s timestamp — the engine aligns counts to orders by exact timestamp match. An order-completion event must also be configured under [Product & Order](/management-portal/oee/equipment/tag-mapping/product-and-order.md) (Single Event start & end mode, or Event Pair Order End). See [Aligning counts with order completion](/management-portal/oee/equipment/tag-mapping/product-and-order.md#aligning-counts-with-order-completion) for the full rules.
{% endhint %}

***

## Quality vs. Performance — sharing counts

The unit counts driving Quality also feed Performance’s "Produced" total. There’s **no separate "produced" tag** — whichever pair you pick here is the source the engine uses for both pillars.

* If your equipment emits a single `units produced` counter and you don’t track quality yet, leave Quality disabled on the [Equipment tab](/management-portal/oee/equipment/settings-and-targets.md). Performance can still be calculated from Cycle Time + Run Time alone.
* When you start tracking quality, enable the Quality pillar and wire a second tag (Approved or Rejected) here. Performance picks up the Total / derived-Total automatically.

***

## Validation

| Condition                                                                                                                                   | Behavior                                                                                                                                                                                                                                |
| ------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Quality pillar enabled and the required tag(s) for the selected pair unset                                                                  | Fields are flagged required; **Data Quality** group shows invalid; Save blocked.                                                                                                                                                        |
| Count tag configured but [Product & Order](/management-portal/oee/equipment/tag-mapping/product-and-order.md) has no order-completion event | An order-completion event is required to align counts with orders. Save blocked — see [Aligning counts with order completion](/management-portal/oee/equipment/tag-mapping/product-and-order.md#aligning-counts-with-order-completion). |
| Source tag emits non-numeric values                                                                                                         | The engine logs and skips the reading. Use [Calculations](/management-portal/oee/equipment/tag-mapping/calculations.md) or a JSONata expression to coerce the value first.                                                              |

***

## Related

* [Equipment Settings & OEE Targets](/management-portal/oee/equipment/settings-and-targets.md) — enable / disable the Quality pillar.
* [Calculations](/management-portal/oee/equipment/tag-mapping/calculations.md) — derive a count when no single tag carries it (e.g. summing per-station rejects into a line total).
