Pivoting a data table means changing it from a tall/skinny format to a short/wide format. Consider the following tall/skinny table, based on a series of temperature measurements:
City |
Month |
Temp |
London |
February |
4 |
New York |
February |
6 |
London |
May |
16 |
New York |
May |
19 |
London |
August |
28 |
New York |
August |
26 |
London |
November |
13 |
New York |
November |
11 |
As we add more observations, the table grows taller, but remains three columns wide. While useful during data collection, this format may not be appropriate for certain types of calculations or visualizations. For example, the entities that interest us are the different cities, so we may want a representation with a single row for each city.
Pivoting this table produces the following (note that avg(Temp) is the average of a single cell):
City |
avg(Temp) for February |
avg(Temp) for May |
avg(Temp) for August |
avg(Temp) for November |
London |
4 |
16 |
28 |
13 |
New York |
6 |
19 |
26 |
11 |
Each city is now represented by a single row. The following steps have been performed during the pivoting:
A row has been created for each unique value in City.
A column has been created for each unique value in Month.
A value from Temp has been entered for each cell in the resulting grid.
The following settings were made in the Pivot Conditioning dialog to produce this result:
Identity: City
Category: Month
Values: Temp
See also:
Example of Pivoting with Aggregation