HiveMQ Pulse Calculations

HiveMQ Pulse calculations are mathematical operations performed across nodes to produce new values such as sum (SUM) or insights such as overall equipment effectiveness (OEE).

In HiveMQ Pulse, calculations occur as close to the data source as possible.
This distributed approach enables instant feedback for real-time decision-making, minimizes cloud dependency, and optimizes resource use.

HiveMQ Pulse Calculation Types

The HiveMQ Pulse distributed calculation engine offers different categories of mathematical operations and analytical functions to process data and generate insights where they are needed most.

Calculation functions can be configured for data nodes that hold operational data (Field, and Tag nodes) to process real-time data and generate actionable insights for industrial operations.

Table 1. Simple Functions in HiveMQ Pulse
Name Definition Expression Language Examples

Absolute

Returns the absolute value of a number. Negative values are converted to their positive equivalent.

abs(value)

abs(-15.7) returns 15.7

Division

Divides the first input value by the second input value. Returns null or error if the divisor is zero.

/

100/4 returns 25

Minus

Subtracts the second input value from the first input value.

-

85-20 returns 65

Min

Returns the smallest value from a set of numeric inputs or data points over a specified timeframe.

Min

Min(12.5, 8.3, 15.7, 9.1) returns 8.3, (Min(temperature_sensor, "5m") returns the minimum value over 5 minutes

Max

Returns the largest value from a set of numeric inputs or data points over a specified timeframe.

Max

Max(12.5, 8.3, 15.7, 9.1) returns 15.7, Max(pressure_sensor, "1h") returns the maximum value over 1 hour

Product

Multiplies all input values together to produce a single result.

Product(value1 * value2 * valueN )

Product(2, 3, 1.5) returns 9

Sum

Adds all input values together to produce a cumulative total.

Sum(value1, value2, …​, valueN) or Sum(tag_name, time_window)

Sum(10, 15, 5, 20) returns 50 or Sum(production_count, "1d") returns the daily total

SMA

Simple Moving Average. Calculates the average of historical tag values over a time period or set of data points.

SMA(tag_name, window_size) or SMA(tag_name, sample_count

SMA(temperature, 10) returns a 10-sample moving average

Rolling Sum

Calculates the cumulative sum of values within a sliding timeframe and continuously updates as new data points arrive.

Rolling_Sum(tag_name, window_size)

Rolling_Sum(parts_produced, "1h") returns the hourly production total (sliding window)

Table 2. Statistical and Aggregation Functions in HiveMQ Pulse
Name Definition Expression Language Examples

Count

Returns the number of valid (non-null) data points within a specified timeframe or sample set.

COUNT

COUNT(production_cycles, "1d") returns a daily cycle count

First

Returns the earliest (oldest) value from a time-series data stream within a specified timeframe.

FIRST(tag_name, time_window)

FIRST(batch_weight, "1d") returns the initial batch weight of the day

Last

Returns the most recent (latest) value from a time-series data stream or dataset.

LAST(tag_name) or LAST(tag_name, time_window)

LAST(temperature_sensor) returns the current temperature reading

MAX_WINDOW

Sets the upper limit of the time interval permitted for data aggregation in statistical computations and time-series analysis functions.

MAX_WINDOW = "24h" or system-configured value

MEAN(temperature, MAX_WINDOW) limits aggregation to the configured duration

MIN_WINDOW

Sets the minimum time interval required for meaningful statistical calculations and data aggregation operations.

MIN_WINDOW = "30s" or system-configured value

STDEV(pressure, MIN_WINDOW) requires at least the minimum duration for calculation

Mean

Calculates the arithmetic average of all values within a specified timeframe or sample set (the sum of all values / the count of values).

MEAN(tag_name, time_window) o r MEAN(tag_name, sample_count)

MEAN(temperature_sensor, "1h") returns the average temperature over 1 hour

Median

Returns the middle value from a sorted dataset.

MEDIAN(tag_name, time_window) o r MEDIAN(tag_name, sample_count)

MEDIAN(cycle_time, 20) returns a median of the last 20 cycle times

STDDEV

Standard Deviation. Calculates the square root of the average squared differences between each data point and the arithmetic mean

STDEV(tag_name, time_window) or STDDEV(tag_name, sample_count)

STDDEV(temperature_reading, 100) returns the temperature stability of the last 100 readings

Variance

Calculates the average of the squared differences between each data point and the arithmetic mean of the dataset

VARIANCE(tag_name, sample_count)

VARIANCE(pressure_sensor, "2h") returns a 2-hour pressure variability measurement

EMA

Exponential Moving Average. Calculates a weighted moving average with more weight on recent values.

EMA(tag_name, alpha) or EMA(tag_name, window_size, alpha)

EMA(temperature, 0.3) returns an exponential average with 30% weighting on new values

OEE

Overall Equipment Effectiveness_. Combines availability, performance and quality factors to calculate a single productivity metric.

OEE(availability, performance, quality)

OEE(480, actual_runtime, 100, actual_rate, good_count, total_count) returns a detailed OEE from components