Standard Functions
Standard functions are pre-built functions provided by PowerTSM that perform calculations on time series data. They accept one or more time series as parameters and return calculated results. Functions can be used in formulas with the syntax: <FunctionName>(<parameters>)
Usage methods:
- Formula time series: Define a time series that calculates results on-demand using the formula
- Ad hoc calculations: Execute calculations directly for immediate analysis
For general formula syntax and operators, see Formulas Overview.
Available Standard Functions
Section titled “Available Standard Functions”PowerTSM provides the following standard functions that are ready to use without configuration or loading. These functions cover common calculation scenarios and are maintained as part of PowerTSM.
| Name | Description |
|---|---|
| BestValue | Returns the data point with the lowest flag priority |
| Average | Returns the average value of multiple time series on a single data point |
| Peak | Returns only data points on Monday to Friday 08:00 - 20:00 |
BestValue
Section titled “BestValue”Returns the time series data point with the lowest flag priority for each timestamp.
Behavior:
- Compares data points from multiple time series
- Data points flagged as
Ignoreare converted toMissingbefore comparison - If no data points are provided, returns a data point with value
0.0and flagMissing
Usage:
BestValue([id/name], [id/name], ...)BestValue accepts multiple time series as parameters (params). Time series can be referenced by their identifier using [id:1] or by their name using [name].
BestValue([TS_A], [TS_B], [TS_C])
Given the following data points at timestamp 2025-01-01T12:00:00:
| Time Series | Value | Flag | Priority |
|---|---|---|---|
| TS_A | 100 | Faulty | 60 |
| TS_B | 95 | Valid | 30 |
| TS_C | 98 | Accounted | 10 |
Result:
The function returns the data point from TS_C with value 98 and flag Accounted, because Accounted has the lowest priority (10).
Average
Section titled “Average”Average accepts multiple time series as parameters and returns their average value on each time stamp. Values with the flag Missing are not taken into account. The resulting average will be assigned the highest priority flag of the input values.
Usage
Average([id/name],[id/name], ... )| TimeSeries1 | TimeSeries2 | Average([TimeSeries1],[TimeSeries2]) |
|---|---|---|
| 10 | valid | 0 | valid | 5 | valid |
| 10 | valid | 0 | missing | 10 | missing |
| 10 | faulty | 0 | valid | 5 | faulty |
| 10 | faulty | 0 | valid | 5 | faulty |
| 10 | estimated | 0 | schedule | 5 | estimated |
Average of three time series
Section titled “ Average of three time series”Average([in1],[in2],[in3])
Returns the average of the three time series for every timestamp. Flag handling follows the table above.
Returns data points without modification, but filters them based on their time stamp. Only values placed on what are considered “peak” hours (Monday to Friday, 08:00 - 20:00) are displayed unaltered. The rest is set to 0. 20:00 is considered the first timestamp to not be in the peak window.
Usage
Peak([id/name])Peak accepts exactly one time series as parameter. The peak window is evaluated in the time zone that is used for the calculation, which defaults to UTC. Both APIs allow that time zone to be set explicitly.
Peak([TestTimeSeries])
Given an hourly time series and a calculation in UTC, values inside the peak window are returned unchanged, while all others are set to 0 with the flag Missing (19):
| Timestamp (UTC) | Input | Result |
|---|---|---|
| Wed 2025-12-17 23:00 | 8 | valid | 0 | missing |
| Fri 2025-12-19 08:00 | 10 | valid | 10 | valid |
| Fri 2025-12-19 09:00 | 11 | valid | 11 | valid |
| Sat 2025-12-20 10:00 | 12 | valid | 0 | missing |
Shifting the calculation time zone shifts the window with it. With CET the peak window of the same series starts at 09:00 UTC instead of 08:00 UTC. Request examples for both cases can be found under Calculating Formulas with the HTTP API.