Pivot
Pivot table (rows to columns)
What It Does
Pivot transforms rows into columns. Choose a row grouping column, a column whose values become new column headers, and a value column to aggregate.
How to Use It
Opening the Panel
Click the + button in the toolbar or press the operation picker, then search for "Pivot". It's in the Aggregate group.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
Group by | Column select | Yes | Row grouping column |
Pivot column | Column select | Yes | Column whose unique values become headers |
Value column | Column select | Yes | Column to aggregate |
Aggregation | Select | Yes | SUM, COUNT, AVG, MIN, MAX |
SQL generated under the hood
PIVOT data ON category USING SUM(revenue) GROUP BY region
Related Operations
- Window Function - Rank, row number, lead, lag
- Smallest - Get nth smallest value as a column
- Largest - Get nth largest value as a column