Skip to content

Date Spine — Hex Reporting Utility

Generates a complete date spine from 2025-01-01 through yesterday, with period bucketing driven by a time_grain parameter input in Hex.

Parameters

Parameter Type Options
time_grain Hex input Day, Week, Month, Quarter

Output Columns

Column Description
dt Raw date (one row per calendar day)
period_start_display_text Human-readable period label (e.g. Jan 2025, Q1 2025)
period_start_date Truncated date for the start of the period — use this for joining or sorting

Usage

Join period_start_date to a fact table's date column to group metrics by the selected time grain. Because every calendar day is present, this spine correctly handles periods with no activity (zero-fill by left joining from the spine).

Notes

  • Row generator produces 6,000 rows (~16 years of daily dates from the anchor date)
  • Filters to dt < CURRENT_DATE to exclude today
  • Anchor date (2025-01-01) can be adjusted if historical data predates it