# Aggregation

Collected data can be aggregated inside **trailing windows** defined by the **Output resolution** (see below). Choose one of:

* **None (Pass-through)**\
  No aggregation. All measurements pass through unchanged.

* **Time Weighted Average**\
  A mean that weights each measurement value by how long it was held within the window. Suited for unevenly spaced or event-driven inputs, illustrated by the example below:<br>

  <figure><img src="https://570593659-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYMGRODsc2QD3N3wmfwTl%2Fuploads%2F68zUMAeV1QuEyzkImYTN%2Fimage.png?alt=media&#x26;token=28acf99f-26ae-4414-9e4a-cf9f25bc8e8a" alt="" width="563"><figcaption><p>Example of trailing window with non-uniform distributed values</p></figcaption></figure>

  \
  Here the Time Weight Average is calculated like this:<br>

  <figure><img src="https://570593659-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYMGRODsc2QD3N3wmfwTl%2Fuploads%2FFx2jsbaSGhUhXewxT3lk%2Fimage.png?alt=media&#x26;token=1ce1a13c-9092-4576-a110-b5520ba6bdb7" alt="" width="265"><figcaption></figcaption></figure>

* **Value Weighted Average (Arithmetic Mean)**\
  Sum of measurement values divided by the count of measurements in the window. Best when measurements arrive at a uniform cadence.

<figure><img src="https://570593659-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYMGRODsc2QD3N3wmfwTl%2Fuploads%2Fw0gCwErOplnIkJjuUv6E%2Fimage.png?alt=media&#x26;token=3aa6b47d-2439-47e4-96e6-3cb225a03dce" alt=""><figcaption></figcaption></figure>

* **Minimum Value**\
  The minimum measurement value observed in the window.
* **Maximum Value**\
  The maximum measurement value observed in the window.
* **Sum of values**\
  The sum of all measurements in the window.<br>

  <figure><img src="https://570593659-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYMGRODsc2QD3N3wmfwTl%2Fuploads%2F95M5387RIt5NhivGRZl4%2Fimage.png?alt=media&#x26;token=aa8bb038-3b07-42a4-ae74-d7d21aa3e314" alt=""><figcaption><p>Calculation of sum</p></figcaption></figure>
* **Count**\
  The number of measurements observed in the window.
* **Standard deviation**\
  The sample standard deviation computed over the window.<br>

  <figure><img src="https://570593659-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYMGRODsc2QD3N3wmfwTl%2Fuploads%2Fe1G63LCJtfYXGB2mRzax%2Fimage.png?alt=media&#x26;token=2b2b7813-4a39-4d2c-8e44-eeb3e91f2f56" alt=""><figcaption><p>Calculation of standard deviation</p></figcaption></figure>

### Output Resolution

**Output resolution** defines the size of the aggregation window and the cadence of produced outputs.

* **0** disables windowing. With **Aggregation = None**, this is a pure pass-through stream.
* If you select any aggregation method other than **None**, the **Output resolution must be > 0**.
* Example: With **1 minute** output resolution, all samples within each minute are aggregated, and exactly one measurement is emitted per minute.

**Resampling with Aggregation = None:**\
If you keep **Aggregation = None** and set a **non-zero** Output resolution, the measurements are **resampled** to that cadence (both up- and downsampling). The **Interpolation** setting determines how measurements are estimated at the new timestamps. See the [interpolation documentation](https://docs.tricloudnexus.io/management-portal/designer/assets/tags/process/interpolation).

### Practical guidance

* Pick **Time Weighted Average** for event-driven or irregular sources; **Value Weighted Average** for evenly sampled sources.
* Choose an **Output resolution** that matches downstream needs (dashboards, analytics) while balancing bandwidth and fidelity.
* If you don’t need aggregation but want a fixed cadence, set **Aggregation = None** and a non-zero **Output resolution**; pair it with the appropriate **Interpolation** mode.
