Five dates and one calendar
A dispatch occurs at 00:30 UTC on January 2.
The interview prompt
A dispatch occurs at 00:30 UTC on January 2. The origin uses a UTC−08:00 offset at that instant. Finance uses a fiscal week and the carrier’s SLA uses local business days. Which dates and keys do you put on the row?
One instant can appear on two dates
At origin the dispatch occurred at 16:30 on January 1. Preserve the original timestamp and the rule or named timezone that produced the business date. A UTC-based reliability dashboard assigns it to January 2. A warehouse shift report may assign it to January 1, or to a shift date with a boundary different from midnight. Resolve the applicable rule by facility and time.
Role-playing dates let ordered and shipped use the same fiscal-calendar attributes independently. “Orders placed in fiscal week 52 and shipped in fiscal week 1” needs two joins or two semantic roles. A single ambiguous date filter can accidentally require both events to fall in the same week. Distinguish this from applying a different fiscal calendar to the same event in another legal entity.
For SLA calculations, store the promise and actual handoff as instants, then apply the service-specific business calendar for holidays, cutoff hours, and weekends. Ask for a test at fiscal year-end and another at the autumn clock change. Two readings of 01:30 on that day can denote different instants. A local timestamp without an offset or equivalent source evidence may be ambiguous.
The model behind the answer
The same date can mean ordered, promised, dispatched, delivered, or refunded. A single calendar dimension can serve all five roles. A query about delivery punctuality compares delivered date with promised date. A demand forecast groups by order date. Label the roles explicitly so a dashboard author can choose the intended clock.
Fiscal week and calendar week are two descriptions of a date. A company with one fiscal calendar can put both in one date dimension. Multiple legal entities with different fiscal calendars need an applicable calendar assignment as well. If Sunday night in Seattle is already Monday at headquarters, derive the local business date under the agreed timezone before looking it up.
Keep the order number on the fact for tracing if it has no independent descriptive attributes. This is a degenerate dimension. It is a practical answer to the candidate who draws one new table for every identifier. Kimball on role-playing dimensions
Review the clock in a generated transformation
Have an agent implement the dispatch-date key for the warehouse shift report. In the ticket, supply the source instant, facility timezone and the rule for assigning shift dates. Keep the finance calendar and carrier deadline as separately named roles.
Reviewer decision. Inspect the generated join with a dispatch at 00:30 UTC on January 2. For the stated UTC−08:00 offset and a local-midnight cutoff it must land on January 1. Keep an order with different placed and dispatched weeks to catch a later refactor that applies one date filter to both roles.
Further reading. The Data Warehouse Toolkit, 3rd ed., on independent date roles in one fact table.
One more question
Finance changes its fiscal calendar after a merger. Must you rewrite every original dispatch timestamp?
Check your reasoning
The physical event is unchanged. Retain the timestamp and version the mapping or its calendar assignment. An issued report can use its original calendar version while a management view uses the revised one. Reconcile totals over the same set of events.
Previous · Two storefronts both sell product 42 · Next · A field guide belongs on two shelves · Complete series map