# Row aggregation

If your data is hierarchical, Inforiver offers the flexibility to apply row aggregations for all branches on a selected level of the hierarchy. You can set different aggregation methods for different levels simultaneously.

To apply a uniform aggregation method to a given level of the hierarchy, navigate to the **Hierarchy** tab in the Manage Aggregation dialog box. Notice that we can assign different aggregation methods for different levels of the hierarchy.

{% hint style="warning" %}
The aggregation type set in the Hierarchy tab will not be applied to formula measures or quick measures created in Inforiver.
{% endhint %}

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FfwuYTtWrBQIwInva4LfM%2Fimage.png?alt=media&#x26;token=445829a1-bd69-4f45-adae-f0658e885e8e" alt=""><figcaption><p>Aggregation set for hierarchy levels</p></figcaption></figure>

The specified aggregation method is set for a specific level of the hierarchy.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FmRKIWhCyRxrFvjM4xg1R%2Fimage.png?alt=media&#x26;token=7becdc51-0ecf-4075-96ea-8df0424c2ed5" alt=""><figcaption><p>Hierarchy-level aggregation</p></figcaption></figure>

### Other methods to set row aggregation

#### 1. Setting aggregation from manage columns

Another way to set row aggregation for measures is by clicking on **Manage Columns** and then the <img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FfpRrjlHwT8JuRqkVXlku%2Fimage.png?alt=media&#x26;token=b22c1b16-2327-4ad4-8c18-1ec03f53bc37" alt="" data-size="line"> icon. This allows you to manage row aggregations for specific measures.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FHXjw6rSvp4pddTVNKea3%2Fimage.png?alt=media&#x26;token=303df4c3-8d75-41a7-bf6b-7b28d1ef62c4" alt=""><figcaption><p>Settings in 'Manage Columns' dropdown</p></figcaption></figure>

A pop-up displays a list of measures under the **Display** section. You can change the aggregation type of multiple measures here.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FY0ZWwGJPJ8yvgZsZ5kcj%2FDisplay.png?alt=media&#x26;token=4af1fc12-1186-4de8-8ec1-76def13917fe" alt=""><figcaption><p>Manage columns pop-up</p></figcaption></figure>

Let's change the aggregation for '2020 Actuals' from 'Sum' to 'Maximum'. Select 'Maximum' aggregation from the dropdown.&#x20;

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FMoqjgsk0zZdsqlg8KYR5%2FChange%20agg.png?alt=media&#x26;token=341b0627-9e53-4fcd-aa14-173013a3e5a8" alt=""><figcaption><p>Column aggregation</p></figcaption></figure>

In the image below, you can see that East -> 2020 Actuals shows 40.18 which is the maximum of Beverages and Water, whereas East -> 2020 Plan shows 45.03 which is the sum of the two categories. &#x20;

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FrRpBOvKt6xGQg3AnZsPt%2FSum%20%26%20maximum%20aggregation.png?alt=media&#x26;token=fea7999d-e04c-449d-a622-542b99e7bfb2" alt=""><figcaption><p>Sum &#x26; maximum aggregation</p></figcaption></figure>

{% hint style="info" %}
You cannot set aggregation for a simulation measure. In the below image, you can see that the aggregation field is disabled for the simulation column.
{% endhint %}

Note that the [row aggregation type](https://docs.inforiver.com/4.-adding-business-logic-and-formulae/insert-manual-input-columns/insert-manual-input-columns#i-row-aggregation-type) for calculated columns and manual data input columns can also be defined here in the **Manage Columns** dialog box in addition to the **Insert formula** and **Data input** [side panels](https://docs.inforiver.com/4.-adding-business-logic-and-formulae/insert-manual-input-columns/insert-manual-input-columns#id-3.-properties). &#x20;

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FsuaOFao34luxF6IJpYL6%2FFor.png?alt=media&#x26;token=6a35c6f8-828d-409f-98a9-80cc0d16fe8d" alt=""><figcaption><p>Simulation column disabled</p></figcaption></figure>

#### 2. Setting aggregation from column gripper

To set aggregation for a specific measure, you can also click on that column's gripper and choose 'Aggregation' from the context menu as shown below. Click on the required aggregation type to apply it to that measure.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FCWfX8hJjGSyIEgs7V7uf%2Fimage.png?alt=media&#x26;token=b275e43e-ec0e-4dab-afec-c39167d82223" alt=""><figcaption><p>Set aggregation from the column gripper</p></figcaption></figure>

In the example below, the 'Forecast' measure has been aggregated to display the maximum value of the child rows using the aggregation method 'Maximum'.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2Fsu5QzycqPri3Szret5WS%2Fimage.png?alt=media&#x26;token=5a7a6803-d3e7-40e3-9f1c-e164ae8d2688" alt=""><figcaption><p>'Maximum' aggregation method in 'Forecast'</p></figcaption></figure>

In the next section, we will learn how to manage column aggregations.
