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. Usefiscal_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 With
custom_calendars to the model file. Map each timeframe to a field in the calendar view:model
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
5
Check the result
Lastly, test the calendar in a workbook query:
- Add the Quarter timeframe of
sold_atand a measure. Each row should show a retail quarter, such as2024-Q1. The first date of each row should matchretail_quarter_startin your calendar table. - Add a
sold_atfilter set tothis quarter. The query should return the current retail quarter, not the Gregorian quarter.
Next steps
custom_calendarsparameter for all properties and query behaviorcustom_calendardimension parameter- Period over period controls on dashboards

