> For the complete documentation index, see [llms.txt](https://docs.decube.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decube.io/reports/asset-report-data-quality-scorecard.md).

# Asset Report: Data Quality Scorecard

Export a per-monitor DQ score for the monitors on a data source over a selected time period.

The Data Quality Scorecard report exports a per-monitor DQ score for the monitors on a data source over a selected time period. Use it to track quality trends, audit monitor coverage, and share DQ metrics with stakeholders outside of Decube. To generate this report, navigate to **Reports** and select the scorecard report type that matches your monitors.

Decube offers two versions of the scorecard:

* **Scorecard V2** covers monitors created in [Data Quality V2](/data-quality-v2/overview.md). Every V2 monitor type contributes a DQ score.
* **Scorecard V1 (legacy)** covers monitors created in the original Data Quality module, and scores supported Field Health monitors only.

{% hint style="info" %}
Each scorecard only includes monitors from its own version. A monitor created in Data Quality V2 appears only in Scorecard V2, and a V1 monitor appears only in Scorecard V1. If you are migrating to V2, align your cut-over date with a reporting period boundary so no single report spans both versions.
{% endhint %}

{% hint style="info" %}
The report preview in the UI is limited to 25 rows. Download the CSV to see the full output.
{% endhint %}

{% tabs %}
{% tab title="Scorecard V2" %}

### How to generate the report

1. Navigate to **Reports** and select **Data Quality Scorecard V2**.
2. Select the **Data Source**, **start date**, and **end date**.
3. Optionally, narrow the output with filters:
   * **Schemas or Tables** — limit the report to the selected schemas or tables.
   * **Quality dimensions** — limit the report to monitors assigned to the selected dimensions.
   * **Data owners** — limit the report to assets owned by the selected users.
   * **Classified assets only** — limit the report to assets that carry a classification.
   * **Monitor types** — limit the report to the selected monitor types.

Without filters, the CSV includes every V2 monitor on the data source.

### How the DQ score is calculated

Every V2 monitor type contributes a DQ score. Decube calculates the score in one of two ways, depending on whether the monitor type reports row counts:

* **Row-based score** — for monitor types that report an error row count and a total row count for each run, such as row-level Field Health checks. The score reflects the share of scanned rows that passed:

  ```
  agg_dq_score = (1 - (agg_error_row_count / agg_total_row_count)) * 100
  ```
* **Run-based score** — for monitor types that don't report row counts, such as Freshness and Volume. The score reflects the share of runs in the date range that passed:

  ```
  agg_dq_score = (1 - (failing_runs / total_runs)) * 100
  ```

The `latest_dq_score` column applies the same logic to the most recent run only:

* **Row-based:** `(1 - (latest_error_row_count / latest_total_row_count)) * 100`
* **Run-based:** `100` if the latest run passed, `0` if it failed.

#### Example: row-based score

A Null check on `customers.email` runs three times in the selected date range, scanning 1,000 rows each time.

| Run        | Error rows | Rows scanned |
| ---------- | ---------- | ------------ |
| 1          | 10         | 1,000        |
| 2          | 0          | 1,000        |
| 3 (latest) | 20         | 1,000        |
| **Total**  | **30**     | **3,000**    |

* `agg_dq_score` = (1 − 30 / 3,000) × 100 = **99.0**
* `latest_dq_score` = (1 − 20 / 1,000) × 100 = **98.0**

#### Example: run-based score

An hourly Freshness monitor runs 24 times in the selected date range. Three runs fail, and the latest run passes.

* `agg_dq_score` = (1 − 3 / 24) × 100 = **87.5**
* `latest_dq_score` = **100**

{% hint style="success" %}
For monitors that use an **Incremental Scan**, use `agg_dq_score` — each run validates only newly arrived rows, so the aggregate reflects quality across the whole period. For monitors that use a **Full Table Scan**, `latest_dq_score` shows the current state of the table, because every run re-scans all rows. See [Scan method](/data-quality-v2/monitors/building-blocks.md#scan-method) for how each option works.
{% endhint %}

### How rows are structured

A single monitor can produce several rows in the CSV:

* **One row per asset.** A monitor has one primary asset and can have additional attribution assets — for example, other tables a Custom SQL query reads from. The report includes one row for each unique asset. These rows are identical except for the asset and ownership columns.
* **One row per configuration version.** If a destructive change created a new [monitor version](/data-quality-v2/monitors/building-blocks.md#destructive-changes-and-monitor-versions) during the date range, each version gets its own rows, scored only on the runs made under that version. Rows for the same monitor share the same `monitor_id` and differ in `configuration_id` and `configuration_version`.

For example, a monitor with one primary asset and two attribution assets that was versioned once during the date range produces 3 assets × 2 versions = **6 rows**.

{% hint style="warning" %}
Rows for the same monitor and version repeat the same metrics for each asset. Deduplicate on `monitor_id` and `configuration_id` before summing or averaging scores across monitors, or the monitor is counted more than once.
{% endhint %}

### CSV columns

Columns appear in the CSV in the order below.

**Report metadata**

| Column                   | Description                                                             |
| ------------------------ | ----------------------------------------------------------------------- |
| `report_generation_date` | The UTC date the report was generated.                                  |
| `last_monitor_scan`      | The UTC timestamp of the most recent monitor run within the date range. |

**Asset and ownership**

| Column       | Description                                              |
| ------------ | -------------------------------------------------------- |
| `data_owner` | Semicolon-separated display names of the asset's owners. |
| `qual_id`    | The fully qualified identifier of the monitored asset.   |
| `source`     | The data source name.                                    |
| `database`   | The database name.                                       |
| `collection` | The schema or collection name.                           |
| `dataset`    | The table or dataset name.                               |
| `column`     | The column name, for column-level monitors.              |

**Monitor configuration**

| Column                  | Description                                                                                                                |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `monitor_name`          | The name of the monitor.                                                                                                   |
| `monitor_id`            | The unique ID of the monitor.                                                                                              |
| `configuration_id`      | The ID of the monitor configuration that produced the row.                                                                 |
| `configuration_version` | The version number of that configuration.                                                                                  |
| `monitor_type`          | The monitor type being run, for example `field_health` or `custom_sql`.                                                    |
| `monitor_description`   | The description of the monitor.                                                                                            |
| `dimension`             | The [DQ dimension](/data-quality-v2/monitors/building-blocks.md) assigned to the monitor.                                  |
| `frequency`             | The operational mode of the monitor's schedule.                                                                            |
| `scan_method`           | The scan method applied to the monitor. For Freshness and Volume monitors, this column shows the detection method instead. |

**Aggregated metrics (across the selected date range)**

| Column                | Description                                                                                             |
| --------------------- | ------------------------------------------------------------------------------------------------------- |
| `failing_runs`        | The number of monitor runs that failed.                                                                 |
| `total_runs`          | The total number of monitor runs.                                                                       |
| `agg_error_row_count` | The sum of error rows across all valid runs. Row-based monitor types only.                              |
| `agg_total_row_count` | The sum of rows scanned across all valid runs. Row-based monitor types only.                            |
| `agg_dq_score`        | The DQ score for the date range. See [How the DQ score is calculated](#how-the-dq-score-is-calculated). |

**Latest snapshot metrics (from the most recent run)**

| Column                   | Description                                                                                                 |
| ------------------------ | ----------------------------------------------------------------------------------------------------------- |
| `latest_error_row_count` | The number of error rows in the latest run.                                                                 |
| `latest_total_row_count` | The number of rows scanned in the latest run.                                                               |
| `latest_dq_score`        | The DQ score of the latest run only. See [How the DQ score is calculated](#how-the-dq-score-is-calculated). |

{% hint style="info" %}
**Dimensions include:** Accuracy, Completeness, Uniqueness, Validity, Timeliness, Consistency, Granularity, Others.
{% endhint %}
{% endtab %}

{% tab title="Scorecard V1 (legacy)" %}

### How to generate the report

Select the **Data Source**, **start date**, and **end date** to generate the report. Without filters, the CSV includes every monitor enabled on the data source.

You can narrow the output with filters:

* **Add Schemas or Add Tables** — limit the report to the selected schemas or tables.
* **Quality dimensions** — limit the report to test types with the selected dimensions.
* **Add an asset owner** — limit the report to assets where this user is the asset owner.
* **Filter by classifications** — limit the report to assets that carry classifications.

### Example output

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-f7e37a6a5bb8f440d881d0673156eb99fbb7f565%2FSCR-20240604-lyfp.png?alt=media" alt="Example Data Quality Scorecard V1 CSV output"><figcaption><p>Example of output CSV</p></figcaption></figure>

The report shows one row per monitor enabled during the selected time period. For example, if you enabled a Not Null monitor on a column, the report shows that monitor's DQ score for the period.

### CSV columns

* `report_generation_date`: The date the report was run.
* `data_owner`: The current assigned owner in the Data Catalog.
* `qual_id`: The fully qualified name of the object in the Catalog.
* `source`, `database`, `collection`, `dataset`, `column`: The name of the Catalog object and where it originates from.
* `Dimension`: The dimension associated with the monitor type.
* `Monitor_name` & `monitor_description`: The name and description added to the monitor (supported on Data Contracts only).
* `Monitor_id`: The unique identifier of the monitor.
* `Monitor_mode`: Whether the monitor ran on a schedule or on demand.
* `Test_type`: See [supported test types](#supported-monitors-with-default-quality-dimension) below.
* `Filter_mode`: How the monitor scans — incrementally (timestamp, SQL expression) or the entire table (all records). Group by `filter_mode` to read the DQ score correctly (see below).
* `Agg_error_row_count`: The aggregated count of rows with erroneous records (for incremental scans).
* `Agg_total_row_count`: The aggregated count of rows scanned in the selected time period (for incremental scans).
* `Agg_dq_score`: The DQ score based on the ratio of `agg_error_row_count` to `agg_total_row_count`.
* `Latest_error_row_count`: The count of rows with erroneous records (for all-records scans).
* `Latest_total_row_count`: The count of rows scanned (for all-records scans).
* `Latest_dq_score`: The DQ score based on the ratio of `latest_error_row_count` to `latest_total_row_count`.

{% hint style="success" %}
Where `filter_mode` is `timestamp` or `sql expression`, use `agg_dq_score` as the monitor's DQ score — it averages all incremental scans in the time period.

Where `filter_mode` is `all records`, use `latest_dq_score` — it reflects the most recent full-table scan.
{% endhint %}

### Supported monitors with default Quality Dimension <a href="#supported-monitors-with-default-quality-dimension" id="supported-monitors-with-default-quality-dimension"></a>

| Test Type                                                                                                                         |
| --------------------------------------------------------------------------------------------------------------------------------- |
| Unique                                                                                                                            |
| Regex                                                                                                                             |
| Email                                                                                                                             |
| UUID                                                                                                                              |
| Null                                                                                                                              |
| Custom SQL (only if [Total Row Count Query](/data-quality/how-to-set-up-monitors/custom-sql-monitors.md#dq-scorecard) is enabled) |

Scorecard V1 excludes any other monitor types from DQ scoring.
{% endtab %}
{% endtabs %}
