> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mangrovesystems.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting Data Rules

> Why a data rule fires when you didn't expect it, stays silent when you did, or leaves a value uncorrected, and what to do about each.

## A rule doesn't fire

**A count over a window on monthly data changes from month to month.** A `TRAILING` window reaches back from the start of the data point being judged, and `1.month` is a fixed 30.44 days, so on monthly data `TRAILING 1.month` holds two values in some months and three in others. Leave room to spare, for example `TRAILING 3.months` for `COUNT(...) >= 3`. See [Rule Expressions](https://docs.mangrovesystems.com/data-rules/rule-expressions.md).

**A `ZSCORE` rule never fires.** The score is empty, and the rule passes, when the window holds fewer than two values or all of them are equal. Because the value being judged is part of its own window, a window needs at least six values to ever score above 2, and eleven to score above 3. See [Rule Expressions](https://docs.mangrovesystems.com/data-rules/rule-expressions.md).

**An empty value passes a range check.** `NOT BETWEEN`, `NOT IN` and `NOT` in front of a single check have no answer for a data point with no value, so it passes. Add `OR ... IS MISSING` to the condition. See [Rule Expressions](https://docs.mangrovesystems.com/data-rules/rule-expressions.md).

**A rule ignores older data, or sees only part of its first month.** A rule checks only data points inside its effective period, and a window total counts only those too. Move **Effective from** back, or start a monthly rule on the 1st. See [Create a data rule](https://docs.mangrovesystems.com/data-rules/create-a-rule.md).

**A stuck-sensor rule leaves the first value of the run alone.** **Repeats in the window** flags every repeat but not the value that started the run. Pick **The whole run** under **What to flag** (or **What to correct**) to include it. See [Rule Expressions](https://docs.mangrovesystems.com/data-rules/rule-expressions.md).

**A Batch Calculation rule stays silent on an empty node.** A comparison against a node with no value passes. Add `IS MISSING` for that node. See [Rules on batch calculations](https://docs.mangrovesystems.com/data-rules/batch-calculation-rules.md).

**A Batch Calculation rule skips some batches.** Batches shown as **Incomplete** or **Error** are not checked when they are calculated. Saving the rule or **Evaluate a period** checks them. See [Rules on batch calculations](https://docs.mangrovesystems.com/data-rules/batch-calculation-rules.md).

## A rule fires more, or differently, than expected

**One bad month raises about 30 alerts.** Every data point in the month shares the month's total, so each one fails. Group the alerts by month when you review them. See [Commonly used rules](https://docs.mangrovesystems.com/data-rules/common-rules.md).

**A verdict changed after later data arrived.** `ROLLING` reaches forward as well as back, and a `CALENDAR` window reads the whole month, including data points after the one being judged. Use `TRAILING` to look only backwards. See [Rule Expressions](https://docs.mangrovesystems.com/data-rules/rule-expressions.md).

**A monthly total doesn't match your spreadsheet.** Months follow your account's time zone, a data point spanning midnight on the 1st counts in full in both months, and empty values add nothing to a `SUM`. See [Rule Expressions](https://docs.mangrovesystems.com/data-rules/rule-expressions.md).

**A batch shows an alert from a rule on a different model.** Batches carry alerts from the upstream batches that fed them and from the data points their calculation used. **Go to batch** on the **Inputs** tab opens the batch where it was raised. See [Alerts on a batch](https://docs.mangrovesystems.com/data-rules/manage-alerts.md#alerts-on-a-batch).

## Alerts and counts

**Alerts disappeared, or dismissed alerts came back.** Changing a rule's condition, dates, action or methods saves a new version, and its results replace the old alerts and their dismissals. A dismissal otherwise holds. See [Manage rule alerts](https://docs.mangrovesystems.com/data-rules/manage-alerts.md).

**The rule page's counts lag behind the results.** Results arrive within seconds; counts are rebuilt in the background and can take a few minutes to catch up. Reload the page.

**An edited rule left a reported batch alone.** Batches in a **Completed** or **Verified** report are not re-checked when a rule changes. See [Rules on batch calculations](https://docs.mangrovesystems.com/data-rules/batch-calculation-rules.md).

**Saving a Batch Calculation rule fails with an unknown node.** The rule is checked against the model's active version, which no longer has that node. Update the reference to a node the active version has. See [Rules on batch calculations](https://docs.mangrovesystems.com/data-rules/batch-calculation-rules.md).

## Corrections

**A substitute rule fired but the value didn't change.** The alert says why. Common causes: more than one correction rule matched the data point, so none was applied; the data point is in a batch on a published report; someone restored the value with **Restore to original**; or no method produced a value. With **Require approval** on, the rule proposes instead of writing. See [How rule corrections behave over time](https://docs.mangrovesystems.com/data-rules/corrections-over-time.md) and [Approve corrections](https://docs.mangrovesystems.com/data-rules/approve-corrections.md).

**A whole-month method left a value uncorrected.** The month hasn't ended, so the rule stops at that method and the methods after it do not fill in. The same applies to a whole quarter or year. Evaluate the period again after it closes. See [Create a data rule](https://docs.mangrovesystems.com/data-rules/create-a-rule.md).

**Editing a rule's methods didn't change values it already corrected.** New methods apply going forward. To redo old corrections, use **Revert run** on the rule's **Runs** tab, then evaluate the period. Using **Restore to original** on the data point instead keeps the measured value, and the rule will not correct that value again. See [How rule corrections behave over time](https://docs.mangrovesystems.com/data-rules/corrections-over-time.md).

**Restore to original went back to the measured value, not the previous correction.** **Restore to original** undoes every correction on the data point at once, while **Revert run** undoes only that run's. To put back an earlier corrected value, type it in on the data point. See [How rule corrections behave over time](https://docs.mangrovesystems.com/data-rules/corrections-over-time.md).

**Generate stops because inputs need approval.** A data point with a proposed correction waiting cannot go into a batch. Approve or reject the proposals first. See [Approve corrections](https://docs.mangrovesystems.com/data-rules/approve-corrections.md).

**The capture rate dropped after a substitution.** A substituted value counts as substituted, not captured. See [Data capture rate](https://docs.mangrovesystems.com/data-collection/data-capture-rate.md).

**A capture-rate rule disagrees with the figure beside the Events table.** Updating the figure does not re-run the rule. Use **Evaluate a period** on the rule's **Runs** tab. See [Data capture rate](https://docs.mangrovesystems.com/data-collection/data-capture-rate.md).

## Evidence checks

**Values that match the document still raise a "could not be read with sufficient confidence" alert.** Below 70% read confidence, every data point mapped to the document gets an alert. Attach a clearer copy. See [Evidence Checks](https://docs.mangrovesystems.com/data-collection/evidence-checks.md).

**A second document that disagrees raises nothing.** When one document passes for a data point, failures from its other documents are cleared. See [Evidence Checks](https://docs.mangrovesystems.com/data-collection/evidence-checks.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.