# Aggregate module

Aggregates are calculated both in on-line and off-line mode, in both modes the same computational code is used.

## **On-line mode**

In on-line mode, the computing is parallel for every user id. For active users, on-line aggregates are calculated and held in memory. After fixed time of user's inactivity, defined in configuration file, aggregates are saved in a database.

## **Off-line mode**

In off-line mode, the computing is also parallel for every user id. Aggregates are calculated basing on retail events saved in a repository. Off-line aggregating can be scheduled.

## **Types of aggregates**

* Counted incremently for all data
* Counted in time window with specific number of events
* Counted in sliding time windows with specific number of events
* Target windows - used to count target (only off-line mode)

One event may belong to multiple windows. A list of calculated aggregates is defined in metadata.

## **List of aggregates**

* Number of occurences
* Sum
* Last value
* Flag
* Minimum value
* Maximum value
* Derived aggregates defined in Java (for example: aggregate1 + aggregate2)
* Aggregates resulting from defined dictionaries (see [Dictionaries](/algolytics/event-engine-user/components-of-metadata.md#dictionaries) section)


---

# Agent Instructions: 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://algolytics-technologies.gitbook.io/algolytics/event-engine-user/aggregate-module.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.
