Using asat Mode in get.myview

Overview

get.myview now supports As At timestamping for CDM views that contain temporal history.

This allows reports and analysts to request the state of a DataMart view as it existed on a specific date, rather than always returning the current active position.

This is an important step toward consistent historical, trend, and period-end reporting.


Why this matters

Many CDM views now include temporal control fields such as:

ACTIVE_FLAG
CREATED_DATE
EXPIRED_DATE

These allow the Data Warehouse to understand when a row became valid and when it was superseded.

Previously, most reporting used the current active row only. With asat mode, users can now ask:

What did this view look like on 21 February 2026?


Example usage

EXEC get.myview
    @token = '<token>',
    @datamart = 'project',
    @viewName = 'meta_codes',
    @version = 'beta',
    @whereClause = '{"mode":"asat","asAtDate":"2026-02-21"}'

JSON control payload

The asat request is supplied through the @whereClause parameter as JSON:

{
  "mode": "asat",
  "asAtDate": "2026-02-21"
}

This allows get.myview to distinguish between:

ModePurpose
currentReturn the latest active position
historyReturn full temporal history
asatReturn the valid position on a specific date

How asat works

When mode is set to asat, get.myview applies temporal logic similar to:

CREATED_DATE <= @asAtDate
AND (
    EXPIRED_DATE IS NULL
    OR EXPIRED_DATE >= @asAtDate
)

This means the returned row must have been valid on the requested date.


Example business use cases

asat mode can support questions such as:

  • What was the project status at the end of last period?
  • Which PRU was assigned to a project on a specific date?
  • What was the recorded employee assignment at month-end?
  • What did the reporting layer show before a later correction was made?

Important distinction: asat is not a snapshot

asat mode reconstructs the operational position from temporal history.

A formal snapshot is different. A snapshot represents a frozen, certified business position for a reporting period.

CapabilityMeaning
asatReplays temporal history for a date
SnapshotFreezes an approved period-end position

Both are useful, but they should not be treated as the same thing.


Recommended use

Use asat when you need to understand the valid CDM position on a specific date.

Use current for normal live reporting.

Use history when analysing changes over time.

Leave a Comment