Skip to content

TIMESERIES splits the numbers by time and lists every period, with zeros where nothing happened. It’s the clause for trend lines.

FROM orders
SHOW total
TIMESERIES month
DURING last_12_months
TIMESERIES day | week | month | quarter | year | day_of_week | hour_of_day

Without SINCE or DURING, TIMESERIES picks a window for its unit:

Unit Window
day The last 30 days
week The last four weeks
month The last three months
quarter The last four quarters
year The last three years

TIMESERIES can be combined with a grouping. Time comes first, then the field:

FROM deals
SHOW won_value
TIMESERIES month
GROUP BY owner
DURING this_year
ON won_at

GROUP BY month also groups by month, but lists only the months that have data. Use it for tables; use TIMESERIES for charts over time.

Add WITH CUMULATIVE_VALUES to add each period to the ones before it. See WITH.