# Tutorials - Managing Data Sources

## Pivot tables

In data processing, a pivot table is a data summarization tool found in data visualization programs such as spreadsheets or business intelligence software. Among other functions, a pivot table can automatically sort, count, total or give the average of the data stored in one table or spreadsheet, displaying the results in a second table showing the summarized data.

## Data needs:

You will use 1 file

### File:

Pivot Tables in Quadrigram are located within the “formulas” menu and they just work as another formula, having the following three inputs:

• Columns: Unique values of a given variable will build the columns of the pivot table.
• Rows: Unique values of a given variable will build the rows of the pivot table.
• Data: Columns and Rows will use “Data” as aggregating variable.

Moreover, you need to select the aggregation mode, currently being:

• Counting
• List
• Mean
• Minimum value
• Maximum value
• First Value
• Last Value
• Ignore

Pivot Tables are super easy to understand when you see an example, so let’s go and draft a couple of examples for your better understanding.

Imagine that we have a table with companies and financial metrics, like the image below: In that table each row is an observation (a company name, its country, industry category and business variables such as sales or profits). We will try to answer the following questions using Pivot Tables:

How much sales are per country and industry?

Insert the Table block into the Pivot Table formula and build the following layout:

• Columns: Category
• Rows: Country
• Data: Sales

Having as a result the following Pivot Table: What is the mean marketvalue per country and industry?

Insert the Table block into the Pivot Table formula and build the following layout:

• Columns: Category
• Rows: Country
• Data: MarketValue
• Aggregation mode: Mean

Having as a result the following Pivot Table: 