# Introduction to Aggregation

## Overview

As described in the Dimensions documentation, [**Dimensions**](/dimensions/introduction-to-dimensions.md) allow you to improve the quality of your Models while reducing complexity, by removing repetition of Calculations.

For instance, you might have several cost items in a business (e.g. Marketing, Salaries, IT, Rent) that you need to perform some common calculations on, such as working capital adjustments.

To do this efficiently, it is best to have these cost items in a single [**Variable**](/variables/variable-basics.md), in this case using a `Cost Type` or similar Dimension. However, the individual cost items are all calculated differently (e.g. Salaries and Rent), so we cannot use the `Cost Type` Dimension for all Calculations - we need to first calculate the individual items separately, and then bring them together under one Variable. This is where we use **Aggregation**.

## Aggregation Example

<figure><img src="/files/NsZxYi3A1eINFS8gd4FQ" alt=""><figcaption><p>Example of a Variable using Aggregation</p></figcaption></figure>

The screenshot above shows the preview for a Variable using Aggregation. The Variable uses a Dimension, `Cost Type` <mark style="color:green;">**(1)**</mark>, with seven children (`Central staff`, `Gym staff`, etc...).

The Variable has a single [**Time Segment**](/variables/time-segments.md) <mark style="color:green;">**(2)**</mark> that uses an Aggregation [**Formula**](/variables/time-segments/time-segment-setup.md#formula) in which the Cost Item Variables are referenced.&#x20;

{% hint style="success" %}
Note that the [**Row Summary**](/variables/summaries.md#row-summary) is set to `Sum`, providing an automatic sum of the seven Variables. This is a much cleaner method of adding these Variables together than creating a dedicated Calculation: (`Central Staff` + `Gym staff + Marketing cost` + `etc...)`
{% endhint %}

The next section explains how to create and configure an Aggregation Variable.


---

# 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://help.taglo.io/aggregation/introduction-to-aggregation.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.
