Skip to content
< Back to FAQ overview

How can I display 8-hour shifts in the Time Series Data Service starting at 03:00?

Problem

Continuous energy data should be grouped to reflect consumption per shift – starting at 03:00, then 11:00, 19:00, and so on.

Solution

With the right query, the data can be grouped into 8-hour intervals that start with a 3-hour offset. This ensures the shift times are displayed correctly instead of starting at midnight (00:00) by default.

Steps

For this example, we’re using the Graph widget – but the process works exactly the same for any other widget.

  1. Select your device and metric (as usual).
  2. Set the SELECT function to last() to display the last value of each interval (avoiding averages).
  3. Optional: For continuous values, add difference() to visualize the energy consumed within each 8-hour interval.
  4. In GROUP BY time, use time(8h,3h):
    • 8h = duration of each bucket
    • 3h = start offset, shifting the beginning from 00:00 to 03:00
    • Result: values at 03:00, 11:00, 19:00, etc.