modellerUpdated 2026-05-06

Configure Calendar Table

What this covers

A calendar table holds one row per date with pre-computed period columns — year, quarter, month, week, day. Period-aware time variants (_ytd, _prior_year, _yoy_growth, ...) can use calendar table columns for period boundaries when the table is present.

A calendar table is not required for time variants. Tessallite computes period boundaries from SQL expressions derived from the hierarchy's calendar type — EXTRACT-based expressions for standard and ISO calendars, fiscal CASE expressions for shifted fiscal years. Calendar tables remain valuable for three use cases:

Tessallite supports six calendar types: Standard (Gregorian), Fiscal, ISO Week, Retail 4-4-5, Hijri (Islamic), and Thai Buddhist. A single model can use multiple calendar types — for example, fiscal for finance and 4-4-5 for retail reporting. Each calendar type is a separate physical table on the source. See Calendar Types for when to use each type.

This article explains how to create, bind, and manage calendar tables.

Before you start

Standard column shape

PeriodColumn name
Datedate_key
Yearyear_no
Halfhalf_no
Quarterquarter_no
Monthmonth_no
Weekweek_no
Day of yearday_no

date_key is the only required column. Period columns are optional but a variant that needs a missing period column will be silently dropped from the catalog.

Choosing the right calendar type

TypeUse whenFiscal start month
StandardReporting follows the common Gregorian calendarn/a
FiscalFinancial year starts on a month other than JanuaryRequired
ISO WeekYou need ISO 8601 week numbering (logistics, EU reporting)n/a
Retail 4-4-5Retail or CPG like-for-like weekly comparisonsn/a
HijriIslamic finance or Middle Eastern government reportingn/a
Thai BuddhistThai government or financial institutionsn/a

Select the type in the Calendar type dropdown when creating or binding a calendar. The type determines which period columns the DDL generates and how period boundaries are computed.

Steps — auto-create

  1. Open the Sources panel in Model Builder.
  2. On the data source row, click the calendar icon. The icon shows blue once a calendar is bound.
  3. Switch to the Auto-create tab.
  4. Select the Calendar type from the dropdown.
  5. If Fiscal is selected, set the Fiscal year start month (e.g. April).
  6. Set Table name (e.g. calendar_fiscal). Enter the table name only — Tessallite qualifies it automatically using the source's schema or dataset configuration:
  1. Choose a start date and end date for the calendar range. Best practice: cover 5 years past and 3 years future to avoid NULL period values on edge dates.
  2. Click Generate. Tessallite emits the dialect-specific DDL (Postgres generate_series, BigQuery GENERATE_DATE_ARRAY, or Spark sequence/explode) and runs it against the source. The new table is registered with autocreated = true and bound automatically. A companion model table alias is created so the calendar participates in joins and time-variant measures.

Auto-create requires write access

The Generate button only runs DDL when the project connection has "Allow Tessallite to run DDL on this source" enabled. This is a deliberate opt-in so Tessallite can never write to a source the operator hasn't explicitly approved. If the flag is off, Generate returns the DDL in the error payload and asks you to use the script + bind path.

To enable the flag: open Connections, edit the connection, and check the "Allow Tessallite to run DDL on this source" checkbox under the connection settings. For BigQuery, the service account also needs the BigQuery Data Editor role (or higher) on the target dataset.

Steps — bind an existing table

  1. Open Sources → Calendar as above.
  2. Click Bind existing.
  3. Enter the table name (schema-qualified if required by your source).
  4. Confirm the column mapping. Tessallite probes the table for the standard column names; if any are missing or use different names, edit the mapping inline.
  5. Click Bind. The catalog refreshes; period-aware variants on measures linked to this source's hierarchy now become admissible.

Unbinding

Click Unbind in the Calendar panel. This removes the registration only — the physical table on the source is never dropped, even if Tessallite created it.

Script-only mode

If your security policy disallows write access from Tessallite, switch to the Get script tab, click Show DDL, copy the output, and run it on your source. Then come back, switch to Bind existing, and bind the table. Same outcome as auto-create, with you in control of the write.

Using the calendar in the model

Period-aware time variants no longer require a calendar table. Setting a calendar type on the time hierarchy is sufficient — Tessallite derives period boundaries from SQL expressions. See Configure Time Variants for the full setup.

When a calendar table IS bound, Tessallite uses its pre-computed columns instead of expression-based boundaries for backward compatibility. This is automatic — the query router detects the calendar table and switches to the column-based path.

A calendar table adds value in these scenarios:

  1. Retail 4-4-5 periods — the irregular 4-week/5-week pattern cannot be expressed as date arithmetic. You must bind a 4-4-5 calendar table for retail period variants to work.
  2. Dense date spine — queries that need every date in a range (including dates with no fact rows) use the calendar table as a dense join source.
  3. Custom period columns — if your organisation uses non-standard period definitions (e.g. 13-period years, company-specific fiscal quarters), store them as columns in a calendar table.

Troubleshooting

Best practices

Pitfalls

Related