---
title: Group and total
project: OpenReports
version: 1.0
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/openreports/1-0/guides/group-and-total/
updated: 2026-11-19T07:46:45.185Z
---

# Group and total

> Group the rows of a report and show the minimum, maximum or sum of number fields.

Grouping turns many rows into one row for each value, for example one row per country. Number fields then show a total for each group.

## Group a report

1. In the report form, select **Group:** and choose a field. Only fields with `"group": true` in the [view](../create-view/) appear.
2. Add the same field to **Fields** so that it shows as a column.
3. Add the number fields you want to total. They get the operation **MAX** at first.

You can group by more than one field, for example by country and then by product.

## Choose the operation

1. Select a number field in **Fields**. The **Update field** window opens.
2. In **Scalar operation**, choose **MIN**, **MAX** or **SUM**.
3. Select **SUBMIT**. The operation appears next to the field name.

![The Update field window with the scalar operation SUM](/files/JapUXr9Hs60f.webp)

| Operation | Result for each group |
|---|---|
| **MIN** | The smallest value. |
| **MAX** | The largest value. |
| **SUM** | The sum of all values. |

## Example

With the group **Country**, the fields **Country**, **Total** (**SUM**) and **Quantity** (**SUM**), and the sort **Total** **Descending**, the report shows one row per country with the total sales and quantity, the biggest first.

## Filters on totals

A filter on a number field that has an operation applies to the total of each group. For example, the filter **Total** `>=` `200` keeps the countries whose sum is 200 or more. See [Filter rows](../filters/).
