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>
  rolling-weeks <integer>
  rolling-months <integer>
  rolling-quarters <integer> 
  rolling-tertiles <integer> 
  rolling-halves <integer> 
  rolling-years <integer> 
  recent-days <integer> 
  recent-weeks <integer> 
  recent-months <integer> 
  recent-quarters <integer> 
  recent-tertiles <integer> 
  recent-halves <integer> 
  recent-years <integer> 
 
<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