> ## Documentation Index
> Fetch the complete documentation index at: https://docs.timetracker.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Grouping and pivots

> Nest report rows inside rows with up to three grouping levels, read subtotals and grand totals, bucket by date, and build an Excel-style pivot matrix.

Grouping turns a long list into a readable summary. Instead of 400 time entries, you get one row per project, with the hours added up.

## The three layouts

| Layout        | What you get                                                                             |
| ------------- | ---------------------------------------------------------------------------------------- |
| **Plain**     | A flat table. One row per record, no grouping.                                           |
| **Subgroups** | Rows nested inside rows, with a subtotal on every level and a grand total at the bottom. |
| **Pivot**     | A matrix. One figure spread across a row axis and a column axis.                         |

You choose in the **Layout** section of the builder.

## How grouping works

Think of grouping as **rows nested inside rows**.

You pick up to three dimensions in order. The first is the outer level. Every record falls into one bucket per level, and TimeTracker adds up the figures for each bucket.

Group by **Client**, then **Project**, then **Member**, and you get:

```
Bluebird Coffee 98h
 Website Redesign 62h
 Sarah Lin 40h
 Jonas Bergman 22h
 Monthly Retainer 36h
 Sarah Lin 36h
Harbor Logistics 140h
 Mobile App 140h
 Jonas Bergman 140h
─────────────────────────────────────────────
Grand total 238h
```

Every level carries its own subtotal, and the levels add up. Bluebird's 98 hours is 62 plus 36. The grand total is 238, which is 98 plus 140.

<Note>
  The nesting order is the reading order. **Client → Project** answers "which clients, and what within them". **Project → Client** answers a different question and reads differently. Drag the levels to change it.
</Note>

## How to group a report

<Steps>
  <Step title="Choose the Subgroups layout">
    Open **Layout** in the builder and pick **Subgroups**.
  </Step>

  <Step title="Open Grouping">
    The **Grouping** section becomes usable. On a Plain report it says: *"Switch the layout to Subgroups to nest rows into grouping levels."*
  </Step>

  <Step title="Add a level">
    Use the dropdown below the list to add a dimension. Adding a level also adds it as a column, so the report shows what it groups by.
  </Step>

  <Step title="Reorder">
    Drag a level by its grip to move it. The top level is the outer one.
  </Step>

  <Step title="Remove">
    Click the **X** on a level to remove it.
  </Step>

  <Step title="Stop at three">
    Three levels is the cap. The add control is disabled once you reach it.
  </Step>
</Steps>

Only dimensions can be grouping levels. Figures cannot – you cannot group by "Reported time".

## Reading a grouped report

| Element                           | What it is                                                               |
| --------------------------------- | ------------------------------------------------------------------------ |
| A **group row**                   | One bucket, with its subtotal across every figure column                 |
| A **chevron**                     | Opens or closes that group                                               |
| **Expand all** / **Collapse all** | Buttons in the toolbar that open or close every group at once            |
| **Show all N**                    | A group with many children loads its rows on demand. Click to load them. |
| **Grand total**                   | A sticky footer row covering the whole filtered set                      |

Click a group's subtotal to open the drill-down panel and see the individual records behind it. See [/reports/build-a-report](/reports/build-a-report).

<Warning>
  Totals always cover the complete filtered set, never just the rows on screen. If the report shows a banner reading *"Showing one page of N records. Totals cover the complete filtered set."*, the numbers are still right.
</Warning>

## Date buckets

Dates are the one dimension where you choose the granularity. Every source offers five buckets:

| Bucket      | Groups into                                          | Keyed as              |
| ----------- | ---------------------------------------------------- | --------------------- |
| **Day**     | The calendar day in your workspace timezone          | A date                |
| **Week**    | The week starting on your workspace's week-start day | The week's start date |
| **Month**   | The calendar month                                   | `YYYY-MM`             |
| **Quarter** | The calendar quarter                                 | `YYYY-Qn`             |
| **Year**    | The calendar year                                    | `YYYY`                |

Group by **Month**, then **Member**, over a **This year** period, and you get a month-by-month breakdown of who worked when.

<Note>
  Buckets follow your workspace timezone and week-start day, so a "week" means the same thing here as it does on a timesheet. See [/concepts/dates-times-and-timezones](/concepts/dates-times-and-timezones).
</Note>

## Sorting a grouped report

Sorting applies to the columns on the report. Add up to three rules in the **Sorting** section, each with a column, a direction, and an **Empty values first** switch.

Sorting by **Reported time**, descending, puts the busiest group at the top – which is normally what you want to read first.

## Pivots

A pivot is a matrix. You choose:

| Field           | What it is                      |
| --------------- | ------------------------------- |
| **Columns (X)** | The dimension across the top    |
| **Rows (Y)**    | The dimension down the side     |
| **Metric**      | The single figure in every cell |

Every cell is that figure for that row and column. The pivot also carries a total per row, a total per column, and one grand total.

Member across Week, measuring Reported time:

```
 Week 1 Week 2 Week 3 Total
Sarah Lin 32h 38h 40h 110h
Jonas Bergman 40h 40h 36h 116h
Ana Ferreira 16h 12h 20h 48h
─────────────────────────────────────────────────
Total 88h 90h 96h 274h
```

### How to build a pivot

<Steps>
  <Step title="Add the columns you need first">
    A pivot draws its axes and metric from the report's existing columns. Add at least two dimension columns and one figure column.
  </Step>

  <Step title="Switch the layout">
    Open **Layout** and pick **Pivot**. Three extra fields appear.
  </Step>

  <Step title="Set the axes">
    Choose **Columns (X)** and **Rows (Y)**. Each menu hides the other axis's current value, so the two can never be the same.
  </Step>

  <Step title="Set the metric">
    Choose the single figure every cell measures.
  </Step>
</Steps>

If a menu has nothing to offer, it tells you why: *"Add at least two dimension columns to pivot."* or *"Add a metric column to fill the matrix."*

### Pivot limits

<Warning>
  A pivot report cannot be exported or printed yet. The **Actions** button is disabled with the tooltip *"Export isn't available for pivot reports yet."* Use the Plain or Subgroups layout if you need a file.
</Warning>

A pivot also uses its axes instead of grouping levels. The **Grouping** section says so: *"Pivot reports use the X and Y axes in the Layout section instead of grouping levels."*

## Totals settings

Three switches in the **Totals** section:

| Switch               | What it says                                |
| -------------------- | ------------------------------------------- |
| **Grand total**      | A footer row summing the whole report       |
| **Subtotals**        | A subtotal row per grouped section          |
| **Percent of total** | Show each row as a share of the grand total |

## Example

Maya Ellis wants to know which Northwind Studio client took the most time this quarter, and who did the work.

<Steps>
  <Step title="Source and period">Time entries, **This month**.</Step>
  <Step title="Layout">**Subgroups**.</Step>
  <Step title="Grouping">**Client**, then **Project**, then **Member**.</Step>
  <Step title="Columns">Reported time, Billable time, Entries.</Step>
  <Step title="Sorting">Reported time, Descending.</Step>
</Steps>

Harbor Logistics tops the list at 140 hours, all on Mobile App, all from Jonas Bergman. Bluebird Coffee follows at 98 hours split across two projects. Maya clicks the Website Redesign subtotal and sees the entries that make up its 62 hours.

To turn the same question into a week-by-week view, she switches the layout to **Pivot**, sets **Rows (Y)** to Member, **Columns (X)** to Week, and the metric to Reported time.

## Permissions

Grouping and pivoting need no extra capability. Two rules still apply:

* Roster dimensions – **Group**, **Manager**, **Job title**, **Employment type** – need roster access, so they do not appear for a role that cannot read the roster.
* The rows folded into every subtotal cover only the people your supervision scope reaches. If that is less than the whole workspace, a note above the table says *"Covering 4 of 12 members – your role only sees the people you supervise."*

See [/concepts/supervision-scope](/concepts/supervision-scope).

## What happens next

A grouped report exports with its nesting intact – the CSV and Excel files carry the subtotal rows, the detail rows and the grand total. Printing does the same. Only pivots are excluded. See [/reports/export-a-report](/reports/export-a-report).

## Common questions

<AccordionGroup>
  <Accordion title="Why only three grouping levels?">
    Three is the cap for both grouping and sorting. Beyond three the table is no longer readable, and the question is usually better answered with a filter.
  </Accordion>

  <Accordion title="Do subtotals add up to the grand total?">
    Yes. Every level is a fold of the records beneath it, and the grand total is the fold of the whole filtered set. Group rows always add up, including the group dimension – somebody in several groups counts once, under their primary group.
  </Accordion>

  <Accordion title="Can I group by a figure like Reported time?">
    No. Grouping is dimensions only. To band a figure, filter on it instead – for example **Reported time is at least 8**.
  </Accordion>

  <Accordion title="What is the difference between the Date field and the Day bucket?">
    **Day** is explicit and always means a calendar day. The older plain **Date** field takes its granularity from the report's period. New reports should use the explicit buckets.
  </Accordion>

  <Accordion title="Why can I not export my pivot?">
    Pivot export is not built yet. The button stays visible but disabled so you can see it exists. Switch to Subgroups to export the same data.
  </Accordion>
</AccordionGroup>

## Troubleshooting

| Problem                                                        | Fix                                                                            |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| Grouping does nothing                                          | The layout is still **Plain**. Switch it to **Subgroups**.                     |
| *"A pivot needs a row, a column and a value. Pick all three."* | Fill all three pivot fields                                                    |
| *"A pivot's rows and columns have to be different things."*    | Pick a different dimension for one axis                                        |
| *"That's too many grouping levels."*                           | Remove a level – the cap is 3                                                  |
| A group is missing rows                                        | Click **Show all N** to load the rest                                          |
| Subtotals look too small                                       | Your scope covers part of the roster. Check the coverage note above the table. |

## Related guides

<CardGroup cols={2}>
  <Card title="Build a report" icon="wrench" href="/reports/build-a-report">
    Every builder section in order.
  </Card>

  <Card title="Date ranges and periods" icon="calendar" href="/reports/date-ranges-and-periods">
    The window your buckets sit inside.
  </Card>

  <Card title="Metrics reference" icon="list" href="/reports/metrics-reference">
    What each subtotal is adding up.
  </Card>

  <Card title="Export a report" icon="download" href="/reports/export-a-report">
    Nested exports, and why pivots are excluded.
  </Card>

  <Card title="Supervision scope" icon="users" href="/concepts/supervision-scope">
    Why a subtotal may cover part of the roster.
  </Card>
</CardGroup>
