Skip to main content
Many retailers report on a 4-5-4 calendar: each quarter has 13 weeks, split into months of 4, 5, and 4 weeks. A custom calendar lets Omni group, filter, and compare a date dimension by those periods instead of Gregorian months and quarters. This guide sets up a retail 4-5-4 calendar for a sold_at dimension. The same steps work for any calendar with one row per date, such as a 13-period or ISO-week fiscal calendar.

When to use a custom calendar

Use a custom calendar when your periods do not start on the first day of a Gregorian month. Examples: a 4-5-4 or 5-4-4 retail calendar, a 13-period calendar, an ISO-week fiscal year, or a broadcast calendar. Use fiscal_month_offset instead when your fiscal year starts on the first day of a Gregorian month. A custom calendar needs a calendar table in your database, while fiscal_month_offset only shifts the start of the year. A custom calendar replaces the fiscal calendar for the dimensions that use it. Keep these limits in mind before you choose a custom calendar:
  • Forecasting does not use the calendar.
  • Period over period is not available on a query with two date fields, or with a sub-day timeframe.
  • Date fill needs a date filter with a start and an end, or a named period such as this year.

Requirements

To follow the steps in this guide, you’ll need:
  • Modeler or Connection Admin permissions for the connection, so you can edit the shared model and run a schema refresh
  • Permission to create a table in your database. The calendar must be a database table. A data input table (uploaded file) only works if the connection’s Schema for table upload property is defined, which pushes the table to the database.
1

Create a calendar table

Create a table in your database with one row for each date. Include every date that your data can contain. Dates outside the table get NULL for each calendar timeframe.Each row holds the date and the periods that the date belongs to:Period columns must hold the first date of the period, such as 2024-02-04. Do not use a year number or a label such as Q1. Omni groups, sorts, and compares on that date.Only calendar_date and the columns you plan to map are required. A calendar that maps only quarter needs two columns.
2

Refresh the schema

Run a schema refresh so the calendar table appears in the model as a view. Note the view name that Omni assigns to the table. The view does not need to be in a topic.
3

Define the calendar in the model file

Add custom_calendars to the model file. Map each timeframe to a field in the calendar view:
model
With year_num mapped, each quarter displays as 2024-Q1. Without it, each quarter displays its first date, such as Feb 4, 2024.
4

Apply the calendar to a dimension

In a view file, add custom_calendar to each date or timestamp dimension that must use the calendar:
sales.view
A custom calendar changes the results of saved content that uses the dimension. A this quarter filter or a period-over-period comparison now uses the calendar’s quarter. Check saved content before you apply a calendar to a dimension.
5

Check the result

Lastly, test the calendar in a workbook query:
  1. Add the Quarter timeframe of sold_at and a measure. Each row should show a retail quarter, such as 2024-Q1. The first date of each row should match retail_quarter_start in your calendar table.
  2. Add a sold_at filter set to this quarter. The query should return the current retail quarter, not the Gregorian quarter.

Next steps