Creating a Custom Calendar (the old way)

NOTE: This procedure applies to calendars created prior to Spectre 7.0(35). They are supported but considered deprecated. For the latest information, see About Spectre Calendars.

You can define a custom calendar as a separate cBase file that allows you to define a custom "period" type column that maps any given date to a user-defined period. The source text file should have one row per period, where the date on each row is the start date for that period. The type of period dictates other numbers that are required to uniquely identify the period, and what those numbers are called. For example:

  • a Fiscal Month calendar would have: Date, Year, Month
  • a Fiscal Quarter calendar would have: Date, Year, Quarter
  • a Fiscal Week calendar would have: Date, Year, Week
  • a Fiscal Week calendar, where the week numbering restarts at the start of each month would have: Date, Year, Month, Week.

If you want more than one period type, define multiple custom calendars.

NOTE: The data must be sorted down on Date. Either the text file itself should be generated sorted, or a sort operation should be specified in the Build file. The Date entry on each period must be the first standard Gregorian day in that period, or null if that period has no days.

Additional NOTES on constructing calendar data sets:

  • Include only the columns needed to uniquely identify a period. For example, a custom Week calendar requires the Date, Year, and Week number.
  • The data set should have one row per period and that row should define the period start date.
  • The data set should be sorted on the Date column before the build.
  • The data set must have a row for every period you expect to use in the data, so you may want to generate some number of historical periods, and some future periods as well, and plan to regenerate the calendar periodically.
  • To reference the calendar cBase from another Build script, use the form:
    column "Period" type="period" calendar="my-custom-calendar.cbase"