# After Date Time Check Examples

Source: https://userguide.qualytics.io/data-quality-checks/after-date-time/deep-dive/examples/

Three real-world scenarios that show how the After Date Time check is typically used in production: enforcing a system cutover, validating a daily ingestion window with a filter, and detecting pre-migration timestamps that should no longer exist. The first two run at 100% coverage and report Record Anomalies; the third lowers coverage and reports a Shape Anomaly instead.

**Tab: System Cutover Enforcement**

**The situation:** BrightCart migrated its identity provider on `2025-12-01 06:15 UTC`. Every row in the `users` table must carry a `last_login_ts` that is strictly later than the cutover; older timestamps mean the row was copied from the legacy system and is no longer authoritative.

**Check configuration**

| Field | Value |
| --- | --- |
| Rule | After Date Time |
| Field | `last_login_ts` |
| Filter | *(none)* |
| Custom Anomaly Description | Off |
| Date | `2025-12-01 06:15 UTC` |
| Coverage | 100% |
| Owner | *(check creator)* |
| Anomaly Assignee | *(Identity Platform on-call)* |
| Description | Login timestamps must be later than the identity-provider migration cutover. |
| Tags | `migration`, `auth` |
| Additional Metadata | `jira: DATA-1024` |
| Status | Active |

**Payload**

```json
{
    "description": "Login timestamps must be later than the identity-provider migration cutover.",
    "rule": "afterDateTime",
    "fields": ["last_login_ts"],
    "container_id": 145,
    "coverage": 1,
    "filter": null,
    "properties": {
        "datetime": "2025-12-01T06:15:00Z"
    },
    "tags": ["migration", "auth"],
    "additional_metadata": {"jira": "DATA-1024"},
    "anomaly_message_field": null,
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 12
}
```

**Sample Data**

| user_id | last_login_ts | email |
| --- | --- | --- |
| C001 | 2025-12-05 18:21:00 | customer031@example.com |
| C010 | 2022-03-01 10:00:00 | customer040@example.com |
| C011 | 2022-03-01 10:00:00 | customer041@example.com |
| C013 | 2025-12-03 09:42:00 | customer043@example.com |

**What gets flagged**

Rows `C010` and `C011` both carry `last_login_ts = 2022-03-01 10:00:00`, which is earlier than the cutover. Coverage is 100%, so each failing row is reported as a Record Anomaly.

> **Example: Record Anomaly**
>
> last_login_ts has the value 2022-03-01T10:00:00Z, which is not later than 2025-12-01T06:15:00Z

**Flowchart**

```mermaid
graph TD
    A["No filter, evaluate all rows"] --> B["Interpret last_login_ts as timestamp"]
    B --> C{"Is last_login_ts ><br/>2025-12-01T06:15:00Z?"}
    C -->|Yes| D["Row passes"]
    C -->|No| E["Flag row.<br/>Record Anomaly per failing row."]
```

**Equivalent SQL**

```sql
-- Rows the After Date Time check would flag.
SELECT u.*
FROM users u
WHERE u.last_login_ts IS NOT NULL
  AND u.last_login_ts <= TIMESTAMP '2025-12-01 06:15:00 UTC';
```

**Tab: Daily Ingestion Window with Filter**

**The situation:** A pipeline writes a `processed_at` value to every row of the `events` table when it lands. Today's batch must contain only rows whose `processed_at` is strictly later than the start of the batch window (`2026-06-19 00:00 UTC`). Earlier `processed_at` values indicate a replay or a backfill that bypassed the daily window.

**Check configuration**

| Field | Value |
| --- | --- |
| Rule | After Date Time |
| Field | `processed_at` |
| Filter | `event_date = current_date()` |
| Custom Anomaly Description | Off |
| Date | `2026-06-19 00:00 UTC` |
| Coverage | 100% |
| Owner | *(check creator)* |
| Anomaly Assignee | *(Ingestion on-call)* |
| Description | Today's events must have processed_at after the start of today's window. |
| Tags | `ingestion`, `freshness` |
| Additional Metadata | `jira: DATA-2045` |
| Status | Active |

**Payload**

```json
{
    "description": "Today's events must have processed_at after the start of today's window.",
    "rule": "afterDateTime",
    "fields": ["processed_at"],
    "container_id": 212,
    "coverage": 1,
    "filter": "event_date = current_date()",
    "properties": {
        "datetime": "2026-06-19T00:00:00Z"
    },
    "tags": ["ingestion", "freshness"],
    "additional_metadata": {"jira": "DATA-2045"},
    "anomaly_message_field": null,
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 18
}
```

**Sample Data** (filtered to `event_date = current_date()`)

| event_id | event_date | processed_at |
| --- | --- | --- |
| e-001 | today | 2026-06-19 02:11:00 |
| e-002 | today | 2026-06-18 23:55:00 |
| e-003 | today | 2026-06-19 04:47:00 |

**Why the filter matters**

The filter runs **before** the comparison, so yesterday's events do not influence today's window. Only rows in the current day are tested against the `2026-06-19 00:00 UTC` boundary.

**What gets flagged**

`e-002` has `processed_at = 2026-06-18 23:55:00`, earlier than the start-of-day cutoff for today's window, so it is the only row reported. 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**
>
> processed_at has the value 2026-06-18T23:55:00Z, which is not later than 2026-06-19T00:00:00Z (applied to records where event_date = current_date())

**Flowchart**

```mermaid
graph TD
    A["Apply filter: event_date = current_date()"] --> B["Interpret processed_at as timestamp"]
    B --> C{"Is processed_at ><br/>2026-06-19T00:00:00Z?"}
    C -->|Yes| D["Row passes"]
    C -->|No| E["Flag row.<br/>Message names the filter:<br/>applied to records where event_date = current_date()"]
```

**Equivalent SQL**

```sql
-- Rows the check would flag in today's window.
SELECT e.*
FROM events e
WHERE e.event_date = current_date()
  AND e.processed_at IS NOT NULL
  AND e.processed_at <= TIMESTAMP '2026-06-19 00:00:00 UTC';
```

**Tab: Detecting Pre-Migration Survivors**

**The situation:** A warehouse migration moved historical `orders` data into a new schema on `1992-01-01 00:00 UTC`. Every order row in the new schema is expected to carry an `o_orderdate` later than that boundary. NULL order dates are allowed on the `unconfirmed` rows produced by a separate manual process and should not be flagged.

**Check configuration**

| Field | Value |
| --- | --- |
| Rule | After Date Time |
| Field | `o_orderdate` |
| Filter | *(none)* |
| Custom Anomaly Description | Off |
| Date | `1992-01-01 00:00 UTC` |
| Coverage | 99.5% |
| Owner | *(check creator)* |
| Anomaly Assignee | *(Warehouse Migration team)* |
| Description | Migrated orders must have an order date later than the migration cutoff. |
| Tags | `migration`, `historical` |
| Additional Metadata | `jira: DATA-3071` |
| Status | Active |

**Payload**

```json
{
    "description": "Migrated orders must have an order date later than the migration cutoff.",
    "rule": "afterDateTime",
    "fields": ["o_orderdate"],
    "container_id": 318,
    "coverage": 0.995,
    "filter": null,
    "properties": {
        "datetime": "1992-01-01T00:00:00Z"
    },
    "tags": ["migration", "historical"],
    "additional_metadata": {"jira": "DATA-3071"},
    "anomaly_message_field": null,
    "template_id": null,
    "status": "Active",
    "owner_id": 7,
    "default_anomaly_assignee_id": 24
}
```

**Sample Data**

| o_orderkey | o_orderdate | o_orderstatus |
| --- | --- | --- |
| 1 | 1991-12-31 10:30:00 | F |
| 2 | 1992-03-15 09:15:00 | O |
| 3 | 1991-12-14 10:25:00 | F |
| 4 | *(null)* | unconfirmed |

**What gets flagged**

Rows 1 and 3 fail because their `o_orderdate` is earlier than the cutoff. Row 4 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**
>
> o_orderdate values are not later than 1992-01-01T00:00:00Z, affecting 2 of 4 asserted records

**Flowchart**

```mermaid
graph TD
    A["No filter, evaluate all rows"] --> B["Interpret o_orderdate as timestamp"]
    B --> C{"Is value NULL?"}
    C -->|Yes| D["Row passes"]
    C -->|No| E{"Is o_orderdate ><br/>1992-01-01T00:00:00Z?"}
    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 o.*
FROM orders o
WHERE o.o_orderdate IS NOT NULL
  AND o.o_orderdate <= TIMESTAMP '1992-01-01 00:00:00 UTC';
```

## See Also

- **How It Works**

  The complete reference: definition, field scope, properties, evaluation flow, NULL handling, filter behavior, and coverage.

  [How It Works](https://userguide.qualytics.io/data-quality-checks/after-date-time/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/after-date-time/deep-dive/anomaly-reporting/)
- **Best Practices**

  Guidelines for choosing the cutoff, normalizing time zones, pairing rules, and keeping the signal clean.

  [Best Practices](https://userguide.qualytics.io/data-quality-checks/after-date-time/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/after-date-time/deep-dive/permissions/)

*Last updated: September 23, 2026.*
