Intervals
This page explains how intervals are defined in PowerTSM, which interval types are supported, and how intervals affect reading and writing time series data.
Interval Type and Length
Section titled “Interval Type and Length”An interval in PowerTSM consists of an interval type (such as second, minute, hour, day etc.) and an interval length (number of interval steps between two timestamps) and determines at which points in time values are applicable on a time series. For example a 15 minute interval can be mapped as interval type “minute” and interval length “15”.
Learn more about cyclic and acyclic behavior in Function and Cyclicality.
Implicit Interval Transformation
Section titled “Implicit Interval Transformation”PowerTSM handles the transformation of input data to the interval of the desired time series by analyzing the intervals of both (input and target data). Thus the time series interval defines the shortest interval in which data can be stored lossless to a time series.
Supported Intervals
Section titled “Supported Intervals”The following interval types are currently available:
| ID | Interval Type |
|---|---|
| 1 | Second |
| 2 | Minute |
| 3 | Hour |
| 4 | Day |
| 5 | Week |
| 6 | Month |
| 7 | Quarter |
| 8 | Year |
| 10 | Millisecond¹ |
¹ Interval type millisecond is only available in a database configured for milliseconds.
Intervals When Reading and Writing Time Series Data
Section titled “Intervals When Reading and Writing Time Series Data”The grid provides a fixed interval for the input and output of time series data. A grid is therefore always defined by an interval type and the corresponding interval length.
Time series data is always queried in their original intervals, unless otherwise specified.
Output grid with aligned vs. shifted start date
Section titled “ Output grid with aligned vs. shifted start date”The output grid is calculated starting from the From date specified in the request and will be rolled out accordingly. I.e. if the starting point (From date) does not intersect with any data point of the underlying time series data, the output grid will have a proportional time shift to the previous existing real data point.
We have a time series with interval Day and the following data:
| From | To | Value | Flag |
|---|---|---|---|
| 2020-12-10 00:00 | 2020-12-11 00:00 | 50.000 | Valid |
| 2020-12-11 00:00 | 2020-12-12 00:00 | 100.000 | Valid |
| 2020-12-12 00:00 | 2020-12-13 00:00 | 0.000 | Missing |
When requesting the data with interval Day starting from 2020-12-10T00:00 (intersecting with a real existing time stamp on the time series) the resulting output will be on exactly the same grid as the underlying data:
| From | To | Value | Flag |
|---|---|---|---|
| 2020-12-10 00:00 | 2020-12-11 00:00 | 50.000 | Valid |
| 2020-12-11 00:00 | 2020-12-12 00:00 | 100.000 | Valid |
When requesting the same data with the same interval, but with a starting point not intersecting with a real existing time stamp on the underlying time series (e.g. 2020-12-10T12:00) the grid will be shifted accordingly (by 12 hours in our example):
| From | To | Value | Flag |
|---|---|---|---|
| 2020-12-10 12:00 | 2020-12-11 12:00 | 75.000 | Valid |
| 2020-12-11 12:00 | 2020-12-12 12:00 | 50.000 | Missing |