October 22, 2026 - Time-based window for the Discrete Statistics block in Analytics Builder

Context


Change Type: Feature
Product area: Analytics
Component: Streaming Analytics
Deployed at: eu.latest.cumulocity.com, apj.cumulocity.com, jp.cumulocity.com, cumulocity.com, us.cumulocity.com

Technical details

Build artifact: apama-in-c8y (27.275.0)
Internal ID: PAB-1974

Description


The Discrete Statistics block has a new optional Window Duration (secs) parameter. Set it to report statistics over the samples received within that duration, instead of over every sample since the model started.

A sample leaves the window once it is older than the window duration. Every sample in the window counts equally, however long it has been there, and the time between samples does not affect the result. The Reset input port clears the window.

The block generates output as samples leave the window, even when no new input arrives. If no new inputs arrive, the block generates output each time the oldest remaining samples expire. The block generates no output when the last sample leaves the window or when the Reset input port clears it, so every output port keeps its previous value until the next sample arrives.

The sampling standard deviation needs at least two samples. If you connect the Sample input port, the block does not output the standard deviation whenever the window holds fewer than two samples.

The window is an approximation. The block divides the window duration into 20 buckets and discards a whole bucket at a time, so a sample stays in the window for the window duration plus up to one bucket duration, and never less. See Windows and buckets for detailed information.

The window duration must be a finite, positive number. The block generates output for expired samples no more than once per the minimum_wait_time_secs value configured for your tenant. If the window duration is less than 20 times that value, samples expire more often than the minimum wait time, so their output may be delayed. See Configuration for detailed information.

If you leave Window Duration (secs) empty, the block behaves as before, keeping every sample since it started or was last reset.

See the description of the Discrete Statistics block for detailed information.