# Is Type Check Examples

Source: https://userguide.qualytics.io/data-quality-checks/is-type/deep-dive/examples/

Three real-world scenarios that show how the Is Type check is typically used in production: validating a numeric staging column, checking a date column for one source with a filter, and auditing a boolean flag mid-cleanup. The first two run at 100% coverage and report Record Anomalies; the third lowers coverage and reports a Shape Anomaly instead.

**Tab: Numeric Staging Column**

**The situation:** A daily CSV lands in a staging table where every column is text. The `amount_raw` column must hold decimal numbers before the transformation casts it; rows holding sentinels break the cast and fail the whole load.

**Check configuration**

| Field | Value |
| --- | --- |
| Rule | Is Type |
| Field | `amount_raw` |
| Filter | *(none)* |
| Custom Anomaly Description | Off |
| Field Type | Fractional |
| Coverage | 100% |
| Owner | *(check creator)* |
| Anomaly Assignee | *(Ingestion team)* |
| Description | Staging amount column must hold decimal numbers. |
| Tags | `staging`, `typing` |
| Additional Metadata | `jira: DATA-9201` |
| Status | Active |

**Payload**

```json
{
    "description": "Staging amount column must hold decimal numbers.",
    "rule": "isType",
    "fields": ["amount_raw"],
    "container_id": 145,
    "coverage": 1,
    "filter": null,
    "properties": {"field_type": "Fractional"},
    "tags": ["staging", "typing"],
    "additional_metadata": {"jira": "DATA-9201"},
    "anomaly_message_field": null,
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 12
}
```

**Sample Data**

| row_id | amount_raw | source_file |
| --- | --- | --- |
| 1 | 1840.50 | feed-01.csv |
| 2 | N/A | feed-01.csv |
| 3 | -12 | feed-01.csv |
| 4 | *(null)* | feed-01.csv |

**What gets flagged**

Row `2` holds the sentinel `N/A`, which cannot be read as a number. Row `3` is a negative whole number, which Fractional accepts. Row `4` is NULL and passes without firing an anomaly. Coverage is 100%, so the failing row is reported as a Record Anomaly.

> **Example: Record Anomaly**
>
> amount_raw has the value N/A, which cannot be read as a decimal number

**Flowchart**

```mermaid
graph TD
    A["No filter, evaluate all rows"] --> B["Read amount_raw"]
    B --> C{"Is value NULL?"}
    C -->|Yes| D["Row passes"]
    C -->|No| E{"Can it be read<br/>as a Fractional?"}
    E -->|Yes| D
    E -->|No| F["Flag row.<br/>Record Anomaly per failing row."]
```

**Equivalent SQL**

```sql
-- Rows the Is Type check would flag.
SELECT s.*
FROM staging_amounts s
WHERE s.amount_raw IS NOT NULL
  AND TRY_CAST(s.amount_raw AS DOUBLE) IS NULL;
```

**Tab: Date Column for One Source, with Filter**

**The situation:** The `events_raw` table receives text from several producers. Only rows from the `legacy` producer are expected to carry a parseable date in `event_date_raw`; the other producers send an epoch value handled by a different rule.

**Check configuration**

| Field | Value |
| --- | --- |
| Rule | Is Type |
| Field | `event_date_raw` |
| Filter | `producer = 'legacy'` |
| Custom Anomaly Description | Off |
| Field Type | Date |
| Coverage | 100% |
| Owner | *(check creator)* |
| Anomaly Assignee | *(Event Platform)* |
| Description | Legacy events must carry a parseable date. |
| Tags | `events`, `typing` |
| Additional Metadata | `jira: DATA-9244` |
| Status | Active |

**Payload**

```json
{
    "description": "Legacy events must carry a parseable date.",
    "rule": "isType",
    "fields": ["event_date_raw"],
    "container_id": 512,
    "coverage": 1,
    "filter": "producer = 'legacy'",
    "properties": {"field_type": "Date"},
    "tags": ["events", "typing"],
    "additional_metadata": {"jira": "DATA-9244"},
    "anomaly_message_field": null,
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 29
}
```

**Sample Data** (filtered to `producer = 'legacy'`)

| event_id | producer | event_date_raw |
| --- | --- | --- |
| E-01 | legacy | 2026-04-11 |
| E-02 | legacy | 11/04/26 ish |
| E-03 | legacy | 2026-04-12 |

**Why the filter matters**

The filter runs **before** the evaluation, so rows from producers that send epoch values are never tested as dates. Only legacy rows are evaluated.

**What gets flagged**

`E-02` carries an annotated, ambiguous value that cannot be read as a date. Coverage is 100%, so the failure is reported as a Record Anomaly, and the message names the filter that scoped the evaluation.

> **Example: Record Anomaly**
>
> event_date_raw has the value 11/04/26 ish, which cannot be read as a date (applied to records where producer = 'legacy')

**Flowchart**

```mermaid
graph TD
    A["Apply filter: producer = 'legacy'"] --> B["Read event_date_raw"]
    B --> C{"Can it be read<br/>as a Date?"}
    C -->|Yes| D["Row passes"]
    C -->|No| E["Flag row.<br/>Message names the filter:<br/>applied to records where producer = 'legacy'"]
```

**Equivalent SQL**

```sql
-- Rows the check would flag among legacy events.
SELECT e.*
FROM events_raw e
WHERE e.producer = 'legacy'
  AND e.event_date_raw IS NOT NULL
  AND TRY_CAST(e.event_date_raw AS DATE) IS NULL;
```

**Tab: Boolean Flag Mid-Cleanup**

**The situation:** A legacy feed writes `is_active_raw` with a mix of textual booleans and free-form answers. A normalization job is rewriting them, and a small fraction is expected to remain unreadable until it finishes, so the check tolerates up to 0.5% failures.

**Check configuration**

| Field | Value |
| --- | --- |
| Rule | Is Type |
| Field | `is_active_raw` |
| Filter | *(none)* |
| Custom Anomaly Description | Off |
| Field Type | Boolean |
| Coverage | 99.5% |
| Owner | *(check creator)* |
| Anomaly Assignee | *(Legacy Migration team)* |
| Description | Active flag must hold a boolean value. |
| Tags | `legacy`, `typing` |
| Additional Metadata | `jira: DATA-9288` |
| Status | Active |

**Payload**

```json
{
    "description": "Active flag must hold a boolean value.",
    "rule": "isType",
    "fields": ["is_active_raw"],
    "container_id": 733,
    "coverage": 0.995,
    "filter": null,
    "properties": {"field_type": "Boolean"},
    "tags": ["legacy", "typing"],
    "additional_metadata": {"jira": "DATA-9288"},
    "anomaly_message_field": null,
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 41
}
```

**Sample Data**

| record_id | is_active_raw | migrated |
| --- | --- | --- |
| R-01 | true | true |
| R-02 | yes, since March | false |
| R-03 | maybe | false |
| R-04 | *(null)* | false |

**What gets flagged**

Records `R-02` and `R-03` hold free-form answers that cannot be read as booleans. `R-04` is NULL, so it passes without firing an anomaly but still counts in the scanned total. Only 50% of the rows pass, which is below the 99.5% coverage threshold, so the check reports a single Shape Anomaly for the dataset with a sample of the offending rows. Coverage below 100% does not produce Record Anomalies.

> **Example: Shape Anomaly**
>
> is_active_raw values cannot be read as true or false, affecting 2 of 4 asserted records

**Flowchart**

```mermaid
graph TD
    A["No filter, evaluate all rows"] --> B["Read is_active_raw"]
    B --> C{"Is value NULL?"}
    C -->|Yes| D["Row passes"]
    C -->|No| E{"Can it be read<br/>as a Boolean?"}
    E -->|Yes| D
    E -->|No| F["Flag row.<br/>Passing rate falls below the 99.5%<br/>coverage, so one Shape Anomaly is reported."]
```

**Equivalent SQL**

```sql
-- Rows the check would flag.
SELECT r.*
FROM legacy_records r
WHERE r.is_active_raw IS NOT NULL
  AND TRY_CAST(r.is_active_raw AS BOOLEAN) IS NULL;
```

## See Also

- **How It Works**

  The complete reference: definition, field scope, the accepted types, matching semantics, NULL handling, arrays, filter behavior, and coverage.

  [How It Works](https://userguide.qualytics.io/data-quality-checks/is-type/deep-dive/how-it-works/)
- **Anomaly Reporting**

  The anomaly messages the check produces, what the numbers mean, Source Records highlighting, and Custom Anomaly Description.

  [Anomaly Reporting](https://userguide.qualytics.io/data-quality-checks/is-type/deep-dive/anomaly-reporting/)
- **Best Practices**

  Guidelines for choosing the type, staging text feeds, pairing rules, and keeping the signal clean.

  [Best Practices](https://userguide.qualytics.io/data-quality-checks/is-type/deep-dive/best-practices/)
- **Permissions**

  The team permission each action needs: view, create, edit, archive, restore, and delete.

  [Permissions](https://userguide.qualytics.io/data-quality-checks/is-type/deep-dive/permissions/)

*Last updated: September 22, 2026.*
