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

# Root Cause Analysis | Incident Management

> Identify root causes of data incidents using observability metrics, lineage context, and entity-level impact traces.

# Root Cause Analysis

Collate provides two tools to help you identify the root cause of a test failure: failed row samples and inspection queries.

## Failed Rows Sample

Some tests produce a failed row sample when they fail. This helps you understand what caused the failure and take corrective action. The failed sample is a subset of the rows that failed the test.

The sample will be collected when the option `computePassedFailedRowCount` is set.

### Supported Test Definitions

The following test types produce a failed row sample on failure:

* [Column Values to Be Not Null](/ai-2-0/how-to-guides/data-quality-observability/quality/tests-yaml#column-values-to-be-not-null)
* [Column Values to Match Regex](/ai-2-0/how-to-guides/data-quality-observability/quality/tests-yaml#column-values-to-match-regex)
* [Column Values to not Match Regex](/ai-2-0/how-to-guides/data-quality-observability/quality/tests-yaml#column-values-to-not-match-regex)
* [Column Values to Be in Set](/ai-2-0/how-to-guides/data-quality-observability/quality/tests-yaml#column-values-to-be-in-set)
* [Column Values to Be Not In Set](/ai-2-0/how-to-guides/data-quality-observability/quality/tests-yaml#column-values-to-be-not-in-set)
* [Column Values to Be Between](/ai-2-0/how-to-guides/data-quality-observability/quality/tests-yaml#column-values-to-be-between)
* [Column Values Lengths to Be Between](/ai-2-0/how-to-guides/data-quality-observability/quality/tests-yaml#column-values-lengths-to-be-between)
* [Custom SQL](/ai-2-0/how-to-guides/data-quality-observability/quality/tests-yaml#table-custom-sql-test)

### Deleting Sample Rows

To delete sample rows, click the three dots above the sample rows table and select `Delete`. Failed sample rows are automatically deleted when the test passes.

<img src="https://mintcdn.com/collatedocs/hzvCWOBUMdmV543T/public/images/features/ingestion/workflows/data-quality/sample-row-failure-deletion.png?fit=max&auto=format&n=hzvCWOBUMdmV543T&q=85&s=aebc5d2b5d33e7b9379f3e06d84cef6b" alt="Sample row deletion confirmation" width="1405" height="383" data-path="public/images/features/ingestion/workflows/data-quality/sample-row-failure-deletion.png" />

### Example

The screenshots below show how to enable the option and what a failed row sample looks like in the UI.

<img src="https://mintcdn.com/collatedocs/hzvCWOBUMdmV543T/public/images/features/ingestion/workflows/data-quality/set_compute_row_count.png?fit=max&auto=format&n=hzvCWOBUMdmV543T&q=85&s=80e970c1384b738e3883b8ffdb1038c1" alt="Enabling the computePassedFailedRowCount option" width="1223" height="847" data-path="public/images/features/ingestion/workflows/data-quality/set_compute_row_count.png" />

<img src="https://mintcdn.com/collatedocs/hzvCWOBUMdmV543T/public/images/features/ingestion/workflows/data-quality/failed_rows_sample_1.png?fit=max&auto=format&n=hzvCWOBUMdmV543T&q=85&s=bc3e1b362588d34a8b3c8b9b8508bb4c" alt="Failed rows sample configuration" width="2846" height="772" data-path="public/images/features/ingestion/workflows/data-quality/failed_rows_sample_1.png" />

<img src="https://mintcdn.com/collatedocs/hzvCWOBUMdmV543T/public/images/features/ingestion/workflows/data-quality/failed_rows_sample_2.png?fit=max&auto=format&n=hzvCWOBUMdmV543T&q=85&s=eeef76ac666a33bd15ddfb91e30cfd25" alt="Failed rows sample" width="2838" height="1122" data-path="public/images/features/ingestion/workflows/data-quality/failed_rows_sample_2.png" />

## Inspection Query

Supported tests generate an inspection query when a test fails. Run this query on the source data to understand what caused the failure and take corrective action.

Add this query to the table to share it with other users.

<img src="https://mintcdn.com/collatedocs/hzvCWOBUMdmV543T/public/images/features/ingestion/workflows/data-quality/inspection-query.png?fit=max&auto=format&n=hzvCWOBUMdmV543T&q=85&s=d8052a0f5829e038a4115f1e4ebde733" alt="Inspection query panel" width="1205" height="497" data-path="public/images/features/ingestion/workflows/data-quality/inspection-query.png" />
