Aggregate functions typically include concepts, such as average, first, sum, etc. Two important value stream functions are resample and moving average:
The Resample(attribute_reference, interval) Function
Resample will find values using interpolation on regular interval timestamps. For instance, the example below will find the current temperature on the hour every hour. When trending or querying against attributes using this, make sure to use "clean" start times, since the start time is used to generate the target timestamps.
Example: resample($.tank_inner_temperature, '1 hour'::interval)
The Simple_Moving_Average(attribute_reference, window_size, interval) Function
This function is great for smoothening noisy signals or for general down-sampling. The window size is the length of time to apply for a time weighted average. Note, that the interval can be the number of intervals between start time (Example 1), or the interval time between values (Example 2):
Example 1: simple_moving_average($.voltage,'1 hour'::interval, 24)
Example 2: simple_moving_average($.voltage,'1 hour'::interval, '10 min'::interval)
Since we look at time series data as continuous value streams, we can apply concepts of calculus, such as derivatives and integrals. That lets us infer valuable properties such as rate of change at a time, or material accumulated over time.
The Rate_of_Change(attribute_reference) Function
Rate of change is calculated numerically by applying a highly secret algorithm.
Example: rate_of_change($.total_volume)
The Material_Accumulated(attribute_reference) Function
Material accumulated always starts at zero on the left side of the requested time interval, and continually accumulates values over time.
Example: accumulated_value($.production_flow_per_second)