# Grouping Records

> Part of the NocoDB documentation (Product docs > Tables > Table Operations > Work with Data). Index of all pages: https://nocodb.com/llms.txt. Any docs page is available as Markdown by adding `.md` to its URL.

URL: https://nocodb.com/docs/product/tables/table-operations/group-by
Last updated: 2026-10-03

Group records in a NocoDB view by up to three levels of fields, with group aggregations.

<img alt="Grouping records" src={__img0} placeholder="blur" />

Grouping in NocoDB organizes records into categories with **Groups** and **Subgroups**. You can group records by up to **three levels**. Grouping makes complex datasets easier to analyze and navigate.

<AskNocoAI>
  <Prompt>
    Group this view by [Status]
  </Prompt>

  <Prompt>
    Group this view by [Owner], then by [Priority]
  </Prompt>

  <Prompt>
    Remove grouping from this view
  </Prompt>
</AskNocoAI>

## Add or edit groups

1. In the toolbar, click **Group By**.
2. Select the field to group records by.
3. (Optional) Sort the groups in ascending or descending order.
4. (Optional) To create a subgroup in the selected group, use `+ New Subgroup`.

<img alt="Group By" src={__img1} placeholder="blur" />

<Callout type="info">
  You can add up to 

  **three levels of grouping**

   to further refine your data view.
</Callout>

You can group by a Link field when each record links to one parent. This applies to belongs-to, one-to-one and many-to-one links. NocoDB groups the records by the display value of the linked record. When you add a record in a group, NocoDB fills in the belongs-to or many-to-one link with the record of that group.

## Enable or disable a group

You can turn a grouping off without removing it. Later, you can turn it on again with the same settings.

1. In the toolbar, click **Group By**.
2. Next to a group, select or clear the checkbox to enable or disable the group.

<img alt="Group By toggle" src={__img2} placeholder="blur" />

A disabled grouping keeps its field and sort configuration. Use it to flatten the view for a time, or to compare grouped and ungrouped layouts without building the setup again.

## Delete groups

1. In the toolbar, click **Group By**.
2. Next to the group to remove, click the 🗑 icon.

<Callout type="info">
  To return to the standard grid view, remove all configured groups.
</Callout>

<img alt="Group By" src={__img3} placeholder="blur" />

## Expand and collapse groups

To collapse or expand a group, click its group header. For bulk actions, open the `...` menu on a group header:

| Option                                | Applies to                          |
| ------------------------------------- | ----------------------------------- |
| **Expand group** / **Collapse group** | The current group and its subgroups |
| **Expand all** / **Collapse all**     | All groups at that level            |

<img alt="Expand and collapse options in the group header menu" src={__img4} placeholder="blur" />

## Group level field aggregations

You can calculate aggregations on fields at each group level. Use them to summarize the data in each group, for example to calculate totals or averages.

<img alt="Group Aggregation" src={__img5} placeholder="blur" />

---

## Related pages

- [Hide & Reorder Fields](https://nocodb.com/docs/product/tables/table-operations/field-operations.md): Hide, show and reorder fields in a NocoDB view from the Fields menu in the toolbar.
- [Filtering Records](https://nocodb.com/docs/product/tables/table-operations/filter.md): Filter records in a NocoDB view with conditions, filter groups, toggle filters and pinned filters.
- [Sorting Records](https://nocodb.com/docs/product/tables/table-operations/sort.md): Sort records in a NocoDB view by one or more fields, in ascending or descending order.
- [Colouring Records](https://nocodb.com/docs/product/tables/table-operations/record-colouring.md): Color records and individual fields in NocoDB views, based on a single select field or on conditions.
- [Record Height](https://nocodb.com/docs/product/tables/table-operations/row-height.md): Set the record height in a NocoDB grid to Short, Medium, Tall or Extra.
- [Freeze Fields](https://nocodb.com/docs/product/tables/table-operations/freeze-fields.md): Freeze up to three fields in a NocoDB Grid view so they stay in place when you scroll horizontally.
- [Search](https://nocodb.com/docs/product/tables/table-operations/search.md): Search for records in a NocoDB table, in one field or in all fields, from the toolbar.
- [Realtime Presence](https://nocodb.com/docs/product/tables/table-operations/realtime-presence.md): See live in NocoDB who else works in a table, with a color marker for each collaborator in the grid.
