# Aggregate Transformation

The Aggregate transformation object provides the functionality to create aggregations of your dataset, using aggregate functions such as Sum, Count, First, Last, Min, Max, Average, Var or StDev. The dataset can be split into groups so that the aggregate value(s) can be generated for the group instead of the whole dataset. For example, calculate product count by month of year, or get average sales price by region and year.

Aggregate Transformation can be applied to unsorted data or data sorted by group by values. When applied to an input stream that is sorted on group by fields, Aggregate Transformation performs substantially better and consumes very little memory. On the other hand, when applied to unsorted data set, Aggregate Transformation may consume substantial memory resources for large data sets and may slow down the performance of the server.

## **Usage**

{% embed url="<https://youtu.be/QgLwOQZW_p4>" %}

## **Steps**

To add an Aggregate transformation, drag the *Aggregate* object from the *Transformations* group in the Flow toolbox and drop it on the dataflow.

An example of what an *Aggregate* transformation might look like is shown below.

![](/files/iLkdc4xx6lik7W6gGPsQ)

To configure the properties of an Aggregate object after it was added to the dataflow, right-click on it and select *Properties* from the context menu. The following properties are available:

* *Record Layout screen:* Using the Record Layout screen, you can select the aggregate functions you wish to create for your dataset, as well as apply any group-by conditions to split your dataset into groups.

{% hint style="info" %}
**Note**: The available aggregate functions are specific to the selected data type of the field that will store the aggregate value.
{% endhint %}

A field’s data type can be selected in the *Data Type* dropdown.

Select an aggregate function from the *Aggregate* dropdown. At least one field in the Record Layout screen should be assigned as a Group-By field. Select *Group-By* from the *Aggregate* dropdown for the field whose values will be used to create data groups.


---

# 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://documentation.astera.com/astera-data-stack-v6/dataflows/transformations/aggregate-transformation.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.
