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

**URL:** <https://community.cumulocity.com/t/october-22-2026-time-based-window-for-the-discrete-statistics-block-in-analytics-builder/15291>\
**Category:** Analytics\
**Tags:** analytics, Feature, streaming-analytics\
**Created:** [October 23, 2026, 7:16am UTC](https://community.cumulocity.com/t/october-22-2026-time-based-window-for-the-discrete-statistics-block-in-analytics-builder/15291 "2026-10-23T07:16:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cumulocity](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/cumulocity/32/31990_2.png) [@cumulocity](https://community.cumulocity.com/u/cumulocity)\
**Post date:** [October 23, 2026, 7:16am UTC](https://community.cumulocity.com/t/october-22-2026-time-based-window-for-the-discrete-statistics-block-in-analytics-builder/15291/1 "2026-10-23T07:16:15Z")

</div>

## Context

* * *

**Change Type:** Feature  
**Product area:** Analytics  
**Component:** Streaming Analytics  
**Deployed at:** [eu.latest.cumulocity.com](http://eu.latest.cumulocity.com), [apj.cumulocity.com](http://apj.cumulocity.com), [jp.cumulocity.com](http://jp.cumulocity.com), [cumulocity.com](http://cumulocity.com), [us.cumulocity.com](http://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](https://cumulocity.com/docs/streaming-analytics/analytics-builder/#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](https://cumulocity.com/docs/streaming-analytics/analytics-builder/#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](https://cumulocity.com/docs/streaming-analytics/block-reference/#discrete-statistics) block for detailed information.
