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

# Pivot

> Convert rows to columns

Pivoting is like flipping your data to see it from a different perspective, making it easier to find patterns or trends. Imagine turning a list of daily sales into a "chart" where each date has its own row and each product becomes a column—it’s the same data but arranged differently. It’s all about reorganizing information so you can focus on the part that matters most for your analysis.

<img className="rounded-md" src="https://mintcdn.com/less-51/am-71qiho-NViN_t/images/tools/pivot/Illustration.png?fit=max&auto=format&n=am-71qiho-NViN_t&q=85&s=911a826b44a11a2b3a8215dc5ab62aee" width="1132" height="612" data-path="images/tools/pivot/Illustration.png" />

<Note>
  The Pivot tool more or less does the reverse of the [Transpose](/tools/reshape/transpose) tool
</Note>

### Configuration

<Steps>
  <Step title="Select Column(s) to Hold Constant">
    Select the column(s) to hold constant. You can imagine that the columns you select here will remain on rows.
  </Step>

  <Step title="Select Header Column">
    Select the column you want to transform into columns. You can only select a single column.
  </Step>

  <Step title="Select Value Column">
    Select the column you want to fill into the values of the column selection you made in Step #2. You can only select a single column.
  </Step>

  <Step title="Select Aggregation">
    Select how you want to aggregation your value column selection from Step #3.

    You can choose from the following types of aggregations:

    * **Sum**: summarize numeric values (numeric columns only)
    * **Average**: find the average of numeric values (numeric columns only)
    * **Min**: find the smallest numeric value (numeric and datetime columns only)
    * **Max**: find the largest numeric value (numeric and datetime columns only)
    * **Count**: count the occurances
    * **Count Distinct**: count the unique occurances
    * **First**: get the first value in the group
    * **Last**: get the last value in the group
    * **Concatenate**: get all your string values in a comma-separated cell (text columns only)
    * **Standard Deviation**: find the standard deviation (numeric columns only)
    * **Variance**: find the variance (numeric columns only)
    * **Median**: find the median (numeric columns only)
    * **Skewness**: find the skewness (numeric columns only)
    * **Kurtosis**: find the kurtosis (numeric columns only)
  </Step>
</Steps>

### Example: The illustration example 👆

We want to pivot our data so our Metric row becomes columns and summarize the Value column per metric. We want to keep our Month constant

<Frame>
  <img className="rounded-md" src="https://mintcdn.com/less-51/qnh8gNMWMbLC5eFp/images/tools/pivot/IllustrationExample.gif?s=55cb4720839644669b67aa8f982a2f42" width="2000" height="1243" data-path="images/tools/pivot/IllustrationExample.gif" />
</Frame>
