# Rolling Functions

## **Overview**

The rolling node allows you to perform calculations across a set of rows related to the current row. Unlike regular aggregate functions, which return a single value for a group of rows, window functions return a value for each row based on the rows within its "window."&#x20;

<figure><img src="/files/Z9fzZDr7EC0Ipr2wpgdm" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Learn more in our tutorial: [Window Functions](/tutorials/window-functions.md)
{% endhint %}

## Settings

#### Set value to

Select the column to calculate aggregation and choose one of the aggregation functions: Average, Count, Min, Max, Sum.

#### Rows window

This parameter defines the range of rows that should be included in the window frame relative to the current row and their sorting.

**starts from - ends with**

Specify the frame using one of the following options:

* All preceding. Includes all rows from the start of the partition to the current row.
* Preceding. Includes the previous **n** rows before the current row.
* Current row. Includes the current row only.
* Following. Includes the next **n** rows after the current row.
* All following. Includes all rows from the current row to the end of the partition.

**sorted by**

This parameter is used to specify the order in which the window function will process the rows. Defining the order, especially when using ranking or numbering functions, is important as it directly impacts the output.

#### Partitioned by

This parameter divides the data into partitions to which the window function is applied. If you don't specify the "Partitioned by" clause, the function will treat the whole result set as a single partition.

#### **Column name**

Enter the name for a newly created column.


---

# 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://docs.tomat.ai/data-transformation/transforms/rolling-functions.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.
