Skip to main content
Time series utilities provide essential functions for working with time-series data, including bucketing data by time intervals, selecting values based on temporal ordering, and performing time-based calculations.

Samples

Time bucketing

Bucket temperature readings into 5-minute intervals and calculate the average:

Ordered selection

Get the first and last temperature values for each device in 1-hour buckets:

Month normalization

Normalize monthly sales metrics to account for varying month lengths:

Available functions

Time bucketing

Ordered selection

  • first(): get the first value in one column when rows are ordered by another column
  • last(): get the last value in one column when rows are ordered by another column

Time utilities

  • days_in_month(): calculate the number of days in a month given a timestamp
  • month_normalize(): normalize a monthly metric based on the number of days in the month