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

# Pivot Tables

> Build a Google Sheets-style pivot table in Tablix — drag fields into Rows/Columns/Values/Filters, choose aggregations, and get a live summary on its own sheet.

Tablix has a full pivot table builder: select a data range, drag fields into Rows, Columns, Values, and Filters, and get a formatted summary table — computed off the main thread so it stays responsive even on large datasets.

## Creating a Pivot Table

<Steps>
  <Step title="Select your data">
    Select a range that includes a header row and at least one row of data.
  </Step>

  <Step title="Insert → Pivot Table">
    From the toolbar, open **Insert → Pivot Table**.
  </Step>

  <Step title="Confirm the range and destination">
    A **Create pivot table** dialog shows the exact range (e.g. `'Sheet1'!A1:D50`) and where to put it.
  </Step>

  <Step title="Editor opens automatically">
    A new sheet is created (named **Pivot Table 1**, **Pivot Table 2**, etc.) and the **Pivot table editor** panel opens automatically so you can start adding fields.
  </Step>
</Steps>

<Warning>
  If your selection doesn't include at least a header row and one data row, you'll see: *"Please select a valid data range with headers to create a Pivot Table."*
</Warning>

<Note>
  In the "Insert to" step, **New sheet** is the only available destination right now — **Existing sheet** is shown with a **"Coming soon"** badge and is disabled.
</Note>

## The Pivot Table Editor

The editor is a two-pane side panel:

<Tabs>
  <Tab title="Left pane — your pivot config">
    Four drop zones: **Rows**, **Columns**, **Values**, **Filters**. Each has a **+ Add** dropdown listing unused fields, and each also accepts fields **dragged in** from the right pane.
  </Tab>

  <Tab title="Right pane — available fields">
    Every column from your source header row, searchable and draggable. Drag any field directly into a Rows/Columns/Values/Filters zone on the left.
  </Tab>
</Tabs>

### Rows & Columns

* Add one or more fields to group data by (multiple fields create a nested hierarchy)
* Each field has its own **sort order** (Ascending/Descending) and **sort by** — either alphabetically by the field's own label, or by the total of a specific Values field
* Empty cells in a grouping field are grouped together as **(blank)**

### Values

* Add one or more fields to aggregate, each with its own **aggregation**: `SUM`, `COUNT`, `AVERAGE`, `MAX`, or `MIN`
* Each value field also has a **Show as** option:

| Show as           | What it displays                            |
| ----------------- | ------------------------------------------- |
| Default           | The raw aggregated number                   |
| % of Grand Total  | This cell's value ÷ the overall grand total |
| % of Row Total    | This cell's value ÷ its row's total         |
| % of Column Total | This cell's value ÷ its column's total      |

### Filters

* Add a field as a filter to get a **checkbox list** of every unique value in that column
* Search values, **Select all** / **Clear all**, and blank cells appear as **(Blanks)**
* A badge shows how many values are currently hidden (e.g. "3 hidden")

### Grand Totals

Toggle **Show grand totals** on/off — when enabled, a Grand Total row and column are added with bold, highlighted styling.

## How It Computes

Every time you change the config, Tablix recalculates the pivot table using a **background Web Worker** — the computation (grouping, aggregating, sorting) never blocks the UI, even on large source ranges. A loading state shows while it's computing.

The result is written into the pivot sheet as a fully formatted, static table:

* Header cells: blue background, white bold text
* Row/column labels and totals: bordered, right-aligned numbers
* Grand Total row/column: highlighted in light blue

<Info>
  The pivot table's output is **regenerated from its config**, not manually editable cell-by-cell — change field placement, aggregation, or filters in the editor, and the whole table refreshes to match.
</Info>

## Editing an Existing Pivot Table

* Switching to a Pivot Table sheet tab **automatically recalculates** it (in case the source data changed) — the editor panel stays closed by default
* Click **Edit Pivot Table** to reopen the editor and adjust fields
* Switching away from the pivot sheet closes the editor panel automatically

## Error Handling

| Message                                                                                       | Cause                                                                  |
| --------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| *"Please select a valid data range with headers to create a Pivot Table."*                    | Your selection didn't include a header row plus at least one data row  |
| *"An error occurred while calculating the pivot table: ..."*                                  | The pivot worker hit an error while computing — check your source data |
| *"An error occurred while generating the pivot table: ..."*                                   | The computed result failed to render onto the sheet                    |
| *"A critical error occurred in the pivot calculation engine. Please check your source data."* | The worker crashed unexpectedly                                        |

See [Error Handling](/error-handling) for Tablix's broader error-handling patterns.

## Related Ways to Summarize Data

Pivot Tables aren't the only way to group and aggregate in Tablix:

* [Formulas](/formulas) — `DSUM`, `DAVERAGE`, `DCOUNT` and other Database functions
* [Python](/python) — `df.groupby(...)` plus `set_data()`
* [SQL](/sql) — a `GROUP BY` query against the `sheet` table
* [AI Assistant](/ai-assistant) — just describe the summary you want in plain English
