> For the complete documentation index, see [llms.txt](https://docs.fractalworks.io/joule/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fractalworks.io/joule/use-case-examples/banking/tumbling-window-analytics.md).

# Tumbling window analytics

***

This example provides a demonstration of the available OOTB aggregate functions Joule provides that work with tumbling windows.

## Use case configuration

*File: app-tumblingWindowAnalytics.env*

```bash
SOURCEFILE=conf/sources/stockQuoteStream.yaml
ENGINEFILE=conf/usecases/tumblingWindowAnalytics.yaml
PUBLISHFILE=conf/publishers/fileStandardAnalytics.yaml
```

## Pipeline configuration <a href="#processor-configuration" id="processor-configuration"></a>

This pipeline will perform two functions. Firstly store every event in the in-memory database and then build 5-second tumbling windows resulting in the defined aggregate functions being executed over the event

{% code overflow="wrap" %}

```yaml
processing unit:
  pipeline:
    - time window:
        emitting type: tumblingQuoteAnalytics
        aggregate functions:
          FIRST: [ask]
          LAST: [ ask ]
          MIN: [ ask ]
          MAX: [ bid ]
          SUM: [ volume ]
          MEAN: [ volatility ]
          HARMONIC_MEAN: [ volatility ]
          VARIANCE: [ volatility ]
          STDEV: [ volatility ]
        policy:
          type: tumblingTime
          window size: 5000

select:
  expression: "symbol, ask_FIRST, ask_LAST, ask_MIN, bid_MAX, volume_SUM, volatility_MEAN, volatility_HARMONIC_MEAN, volatility_VARIANCE, volatility_STDEV"

group by:
  - symbol
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fractalworks.io/joule/use-case-examples/banking/tumbling-window-analytics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
