# Pivot Table

## Overview

* &#x20;Pivot Table is a powerful tool used in data analysis and business intelligence.
* Like Microsoft Excel, it helps in extracting significance from a large, detailed data set by allowing the users to rearrange and aggregate data with a simple drag-and-drop interface.&#x20;
* By organizing and grouping the data, Pivot Table facilitates the identification of patterns and insights, making it an invaluable feature for anyone looking to analyze trends, comparisons, and patterns in their data.

<figure><img src="/files/DBM8TCu5jxxY9Fbm26eT" alt=""><figcaption></figcaption></figure>

* First, click on any "+ Add widget" button to add a widget.

<figure><img src="/files/OUQbsaVFFBf4sodzmFHf" alt=""><figcaption></figcaption></figure>

* Click on the Pivot Table option.
* Click on the Add widget button to proceed.

<figure><img src="/files/SYnOfmJ72tyPzxTN9XJM" alt=""><figcaption></figcaption></figure>

* Choose the available Collection or Connection of the data model that has been added.

## Set up your Pivot Table

* The Pivot table shall be in Grouped mode as default.

### Add Columns&#x20;

<figure><img src="/files/Z1tRKoIHSOIJp89oO9wC" alt=""><figcaption></figcaption></figure>

* Click on the Columns box.

<figure><img src="/files/fWTgG1nI7S9D46FkdhXr" alt=""><figcaption></figcaption></figure>

* The All fields pop-up will appear with all the available columns of the data model.
* Simply drag and drop one or many fields into the Columns.
* You can also drag and drop the fields to Rows and Values.&#x20;

{% hint style="info" %}
You can not select again the fields you have used for Rows and Values.
{% endhint %}

* Click the Done button and the X button to close the All fields pop-up.

### Add Rows&#x20;

<figure><img src="/files/TQKWam5xTILuYAD1Kzt9" alt="" width="563"><figcaption></figcaption></figure>

* Click on the Rows box.

<figure><img src="/files/CkRndEBA8fybjRA5sKWd" alt="" width="563"><figcaption></figcaption></figure>

* The All fields pop-up will appear with all the available columns of the data model.
* Simply drag and drop one or many fields into the Rows.
* You can also drag and drop the fields to Columns and Values.&#x20;

{% hint style="warning" %}
You can not select again the fields you have used for Columns and Values.
{% endhint %}

* Click the Done button and the X button to close the All fields pop-up.

### Add Values

<figure><img src="/files/j92kYB7UDsCtcDfnAuY0" alt="" width="563"><figcaption></figcaption></figure>

* Click on the Values box.

<figure><img src="/files/TD832fhPL6SfKeKodue3" alt="" width="563"><figcaption></figcaption></figure>

* The All fields pop-up will appear with all the available columns of the data model.
* Simply drag and drop one or many fields into the Values.
* You can also drag and drop the fields to Columns and Rows.&#x20;

{% hint style="warning" %}
You can not select again the fields you have used for Columns and Rows.
{% endhint %}

<figure><img src="/files/tVEQeeIidcRMgfUBu7aN" alt=""><figcaption></figcaption></figure>

* Choose the [Formula](/docs/dashboard/footer-formula.md) to display your desired metric.

{% hint style="info" %}
The default formula is Sum.
{% endhint %}

<figure><img src="/files/Ix3wqJ7DKp0eO1h7NMdz" alt="" width="330"><figcaption></figcaption></figure>

* You can click on the 🖊 icon to [customize](/docs/dashboard/custom-column-configuration.md) the selected Values.

<figure><img src="/files/0uot0SEJcBYvrHsg1OKm" alt="" width="563"><figcaption></figcaption></figure>

* You can also customize the selected Values by clicking on the 🖊 icon in the Pivot table.

***

{% hint style="info" %}
To create a Pivot table, you only need to add Columns or Rows with Values.
{% endhint %}

## Apply your selections

<figure><img src="/files/RrJJs8jej4XDzWZzz8nX" alt=""><figcaption></figcaption></figure>

* Your Pivot Table setup has been completed.
* Click the Save changes button to confirm your setup.

{% hint style="info" %}

* You can build the Pivot Table with just only Columns or Rows with Values.
* Use the search bar in the All fields pop-up to find your desired columns.
  {% endhint %}

## Grand Totals

<figure><img src="/files/6vRTOQBw3tTApqZ7lqd1" alt="" width="563"><figcaption></figcaption></figure>

* Toggle this on if you want to see the Grand totals.

## Add more or change fields

<figure><img src="/files/Hdje6ipbQJ1Zn8VRX26J" alt=""><figcaption></figcaption></figure>

* To add more new fields in any section, first, click on the See more button.

<figure><img src="/files/OsOPbJtrH2aBRsugWoi7" alt="" width="563"><figcaption></figcaption></figure>

* Click on the Add field button then begin to drag and drop the available field to your desired section.

<figure><img src="/files/tQuaPNn7qneVHacNifN2" alt=""><figcaption></figcaption></figure>

* To move a field to another section, simply click and hold then move that field.

## Clean fields

<figure><img src="/files/whLtSPeZrXusT1S6R4DZ" alt=""><figcaption></figcaption></figure>

* To clean a field, click on the X button right next to it.

<figure><img src="/files/XxP0H4feolzWqdqSEMD1" alt=""><figcaption></figcaption></figure>

* To quickly clean all the fields in a section, click the Clear all button in the See more menu.

## Quickly Expand and Collapse&#x20;

<figure><img src="/files/KArzwXVSVmGjBa5XVeQW" alt=""><figcaption></figcaption></figure>

* If you have multiple rows, it will add the same as Grouping Table.
* You can quickly expand/collapse the whole group or just a sub-group by clicking the button and then choosing.

<figure><img src="/files/AolxjfxHLqkpLKITwraW" alt="" width="563"><figcaption></figcaption></figure>

* The state of expansion/collapse will be saved on each device.

***

## Change to the Pivot Table type from another widget

<figure><img src="/files/xEon1XtIh00MIw35EnkZ" alt=""><figcaption></figcaption></figure>

* The Pivot Table option can be selected by opening the Settings slider and then clicking on the Properties option.

<figure><img src="/files/BMiDo2zECsHJKvkrVSE8" alt=""><figcaption></figcaption></figure>

* Click on the View type dropdown and choose the Pivot Table icon to begin configuring your data model to the Pivot Table.

<table data-view="cards"><thead><tr><th align="center"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td align="center"><a href="/pages/xdW1hNyQjXYjm5Cg0MzP">Pivot Table - Filter</a></td><td></td></tr><tr><td align="center"><a href="/pages/3P4hmryv6wejqUsKHxa0">Pivot Table - Sort</a></td><td></td></tr></tbody></table>


---

# 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://endash-guidance-docs.gitbook.io/docs/dashboard/widget-types/pivot-table.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.
