Time Series Grammar

The latest syntax for 7.x Spectre Time Series is as follows. Any deprecated syntax is still supported.

time-series [<name:string>] [label=<string>] {
  date <column name or expression>
  anchor <expression>
  [label-order <string>]
  [filter <expression>]
  [summary <name:string> [label=<string>] [{
    [calc-set <string>
  ...]
  }]
  ...]
  [ranges {
    [<range> [label=<string>] [format=<string>] [label-format=<string>]]
  }]
  [variations {
    [<variation> [label=<string>] [format=<string>]]
  }]
  [calc-set <string>
    ...]
}
 
<range> one of:
  current-day
  current-week
  current-month
  current-quarter
  current-tertile
  current-half
  current-year
  week-to-date
  month-to-date
  quarter-to-date
  tertile-to-date
  half-to-date
  year-to-date
  all-months
  all-quarters
  all-tertiles
  all-halves
  rolling-days <integer> [forward=<boolean>]
  rolling-weeks <integer> [forward=<boolean>]
  rolling-months <integer> [forward=<boolean>]
  rolling-quarters <integer> [forward=<boolean>]
  rolling-tertiles <integer> [forward=<boolean>]
  rolling-halves <integer> [forward=<boolean>]
  rolling-years <integer> [forward=<boolean>]
  recent-days <integer> [forward=<boolean>]
  recent-weeks <integer> [forward=<boolean>]
  recent-months <integer> [forward=<boolean>]
  recent-quarters <integer> [forward=<boolean>]
  recent-tertiles <integer> [forward=<boolean>]
  recent-halves <integer> [forward=<boolean>]
  recent-years <integer> [forward=<boolean>]
 
<variation> one of:
  default
  previous-year [{
    [<subvariation> [label=<string>] [format=<string>]
    ...]
  }]
 
  previous-years <integer> [{
    [<subvariation> [label=<string>] [format=<string>]
    ...]
  }]
 
  previous-range [{
    [<subvariation> [label=<string>] [format=<string>]
    ...]
  }]
 
  previous-ranges <integer> [{
    [<subvariation> [label=<string>] [format=<string>]
    ...]
  }]
 <subvariation> one of:
  difference
  percent-difference