---
description: >-
  Pivot tables create new metrics from distinct dimension values.  For example,
  you might want a different column for each date period in the report.
---

# Pivot Tables

Pivot tables are a fundamental component of any spreadsheet.  The reporting system produces data in the form of a grid where each row represents a unique combination of each dimension.  Pivoting rotates the chart so that values in a dimension become new columns.

## An Example Pivot

This is best described with an example.  Suppose you want a table of how many shipments each customer did in each of the last three months.&#x20;

| Column            | Type      |
| ----------------- | --------- |
| Customer Name     | Dimension |
| Month of Shipment | Dimension |
| Shipment Count    | Metric    |

This may result in the following dataset

| Customer Name  | Month of Shipment | Shipment Count |
| -------------- | ----------------- | -------------- |
| Joe Shipper    | 2020-01           | 5              |
| Joe Shipper    | 2020-02           | 4              |
| Joe Shipper    | 2020-03           | 31             |
| Acme Logistics | 2020-01           | 4              |
| Acme Logistics | 2020-02           | 32             |
| Acme Logistics | 2020-03           | 3              |
| New Customer   | 2020-02           | 5              |
| New Customer   | 2020-03           | 30             |

It may be more useful to have customers in the Y axis (rows) with Months in the X axis (columns).  To accomplish this you need to Pivot the table on the **Month of Shipment** for the metric **Shipment Count**.

This results in the following table instead

| Customer Name  | 2020-01 | 2020-02 | 2020-03 |
| -------------- | ------- | ------- | ------- |
| Joe Shipper    | 5       | 4       | 31      |
| Acme Logistics | 4       | 32      | 3       |
| New Customer   |         | 5       | 30      |

This structure makes it readily apparent where data is missing and makes it easier to spot trends or find information.

## Configuring a Pivot

Pivots are a Report **Feature** so they are configured after you have designed your report.  Once you have created a report, in the Reports table find your report and click on the **Features** button. &#x20;

![](https://1742679714-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnQQqtG9nPC-864yuG4%2F-M7noH8hKNFpItWBiUt1%2F-M7nvFDwRLZAThdW-CnU%2Fimage.png?alt=media\&token=c68c609c-f698-4310-b049-b3a331b31773)

In the **Pivots** section, you can click **Add Item** to create a new Pivot.&#x20;

![](https://1742679714-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LnQQqtG9nPC-864yuG4%2F-M7noH8hKNFpItWBiUt1%2F-M7nt4oM31OKxSRgiJcI%2Fimage.png?alt=media\&token=465c662f-483d-40f4-a985-03df3602acac)

For each pivot you must select the Dimension (representing the column from which all the unique values for the new metrics are taken) and the Metric (the column from which the new metric values are taken).

Click **Save** to store your changes to the report. &#x20;

{% hint style="info" %}
Note that if you change your report design, and Features you configured will be lost and you must configure them again.
{% endhint %}

{% hint style="warning" %}
You may create multiple pivots but note that each pivot removes the Dimension and the Metric from the table.  You cannot use those columns in successive pivots.
{% endhint %}
