# 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: 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:

```
GET https://docs.cascade.io/cascade/tools/transform/pivot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
