> For the complete documentation index, see [llms.txt](https://docs.cascade.io/cascade/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cascade.io/cascade/tools/transform/pivot.md).

# Pivot

Pivot takes a table and summarizes it, creating a new summary table based on the values of the source table.

| Selection              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Rows**               | The unique values of each selection will be displayed as the row headers of your Pivot table. If multiple options are selected, each unique combination of those selections are listed in the table. For example, if `{City}` and `{State}` are both selected as **Rows**, the table will list each unique City-State pair.                                                                                                                                                                                                                                                                                                                                                          |
| **Columns** (optional) | The unique values of each selection will be displayed as the column headers of your Pivot table. If a selection is made, the Pivot table columns will reflect the unique values of that selection. For example, selecting `{State}` will list every unique State in the original table. Max 1,000 columns.                                                                                                                                                                                                                                                                                                                                                                           |
| **Values** (optional)  | <p>The summarized values of each Values selection will appear in the body of the Pivot table. By default, the count of unique values is shown.</p><p>If there is no selection made for <strong>Columns</strong>, each <strong>Values</strong> selection will appear as a column header.</p><p>You may aggregate each <strong>Values</strong> selection with one of the following options:</p><ul><li>Count: Number of non-null values (can be used on text columns)</li><li>Sum: Numeric total</li><li>Min: Minimum value</li><li>Max: Maximum value</li><li>Std\_dev: Standard deviation of values</li><li>CountD: Count of distinct values (can be used on text columns)</li></ul> |


---

# 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.cascade.io/cascade/tools/transform/pivot.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.
