> For the complete documentation index, see [llms.txt](https://docs.corraldata.com/kb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.corraldata.com/kb/organize-your-data/pivot-tables.md).

# Pivot Tables

A regular table widget shows one row per record. A **pivot table** (Table V2) lets you group, summarize, and restructure that same data on the fly — rolling many rows into subtotals by category, location, or any column you choose, without writing new SQL.

***

### How it works

Pivot tables work off the same underlying query as a regular table — you're changing how the results are grouped and displayed, not the data behind them. Columns can be dragged into roles:

* **Row Groups** — columns to group rows by (for example, location, then provider).
* **Column Labels** — columns whose values become their own columns across the top (for example, one column per month).
* **Values** — the numbers being summarized (sum, average, count, etc.) for each group.

You can freeze columns so they stay in view while scrolling a wide pivot, and rename columns from the same place you rename them on any table — Edit Widget → Column Settings.

{% hint style="info" %}
You don't have to build a pivot table by hand — you can ask AskCorral for one directly ("break this down by location and month") and it will set up the grouping for you.
{% endhint %}

***

### Turning a table into a pivot table

{% stepper %}
{% step %}

#### **Open the widget's column settings**

From **Edit Widget**, open the Columns panel for a table widget.
{% endstep %}

{% step %}

#### **Drag columns into place**

Drag the columns you want into **Row Groups**, **Column Labels**, or **Values** to build the layout you want.
{% endstep %}

{% step %}

#### **Freeze columns if needed**

For a wide pivot, freeze one or more leading columns so they stay visible as you scroll.
{% endstep %}

{% step %}

#### **Save**

Save the widget. The board reflects the new layout for everyone who views it.
{% endstep %}
{% endstepper %}

***

### Where this fits

* See Edit Widgets for the rest of what's available in a widget's settings beyond pivoting.
* See Change chart type if you're deciding between a pivot table and a chart for the same data.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.corraldata.com/kb/organize-your-data/pivot-tables.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
