HOME

TheInfoList



OR:

A pivot table is a table of grouped values that aggregates the individual items of a more extensive table (such as from a
database In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases ...
,
spreadsheet A spreadsheet is a computer application for computation, organization, analysis and storage of data in tabular form. Spreadsheets were developed as computerized analogs of paper accounting worksheets. The program operates on data entered in ...
, or business intelligence program) within one or more discrete categories. This summary might include sums, averages, or other statistics, which the pivot table groups together using a chosen aggregation function applied to the grouped values. Although ''pivot table'' is a generic term,
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washi ...
held a trademark on the term in the United States from 1994 to 2020.


History

In their book ''Pivot Table Data Crunching'', Bill Jelen and Mike Alexander refer to
Pito Salas Pito Salas is a Curaçaoan-American Cambridge, Massachusetts-based software developer. While working with Lotus Advanced Technology Group in 1986, Salas invented the pivot table, a "next-generation" spreadsheet concept that was released by Lo ...
as the "father of pivot tables". While working on a concept for a new program that would eventually become
Lotus Improv Lotus Improv is a discontinued spreadsheet program from Lotus Development released in 1991 for the NeXTSTEP platform and then for Windows 3.1 in 1993. Development was put on hiatus in 1994 after slow sales on the Windows platform, and officially ...
, Salas noted that spreadsheets have patterns of data. A tool that could help the user recognize these patterns would help to build advanced data models quickly. With Improv, users could define and store sets of categories, then change views by dragging category names with the mouse. This core functionality would provide the model for pivot tables.
Lotus Development Lotus Software (called Lotus Development Corporation before its acquisition by IBM) was an American software company based in Massachusetts; it was "offloaded" to India's HCL Technologies in 2018. Lotus is most commonly known for the Lotus 1- ...
released Improv in 1991 on the
NeXT Next may refer to: Arts and entertainment Film * ''Next'' (1990 film), an animated short about William Shakespeare * ''Next'' (2007 film), a sci-fi film starring Nicolas Cage * '' Next: A Primer on Urban Painting'', a 2005 documentary film Lit ...
platform. A few months after the release of Improv,
Brio Technology Brio Technology was a San Francisco Bay area software company cofounded in 1984 by Yorgen Edholm and Katherine Glassey. The company is best known for their business intelligence software systems, starting with DataPivot on the Apple Macintosh. Brio ...
published a standalone
Macintosh The Mac (known as Macintosh until 1999) is a family of personal computers designed and marketed by Apple Inc., Apple Inc. Macs are known for their ease of use and minimalist designs, and are popular among students, creative professionals, and ...
implementation, called DataPivot (with technology eventually patented in 1999).
Borland Borland Software Corporation was a computer technology company founded in 1983 by Niels Jensen, Ole Henriksen, Mogens Glad and Philippe Kahn. Its main business was the development and sale of software development and software deployment product ...
purchased the DataPivot technology in 1992 and implemented it in their own spreadsheet application,
Quattro Pro Quattro Pro is a spreadsheet program developed by Borland and now sold by Corel, most often as part of Corel's WordPerfect Office suite. Characteristics Historically, Quattro Pro used keyboard commands close to those of Lotus 1-2-3. While i ...
. In 1993 the Microsoft Windows version of Improv appeared. Early in 1994
Microsoft Excel Microsoft Excel is a spreadsheet developed by Microsoft for Microsoft Windows, Windows, macOS, Android (operating system), Android and iOS. It features calculation or computation capabilities, graphing tools, pivot tables, and a macro (comp ...
 5 brought a new functionality called a "PivotTable" to market. Microsoft further improved this feature in later versions of Excel: *Excel 97 included a new and improved PivotTable Wizard, the ability to create calculated fields, and new pivot cache objects that allow developers to write
Visual Basic for Applications Visual Basic for Applications (VBA) is an implementation of Microsoft's event-driven programming language Visual Basic 6.0 built into most desktop Microsoft Office applications. Although based on pre-.NET Visual Basic, which is no longer support ...
macros to create and modify pivot tables *Excel 2000 introduced "Pivot Charts" to represent pivot-table data graphically In 2007 Oracle Corporation made PIVOT and UNPIVOT operators available in
Oracle Database Oracle Database (commonly referred to as Oracle DBMS, Oracle Autonomous Database, or simply as Oracle) is a multi-model database management system produced and marketed by Oracle Corporation. It is a database commonly used for running online ...
11g.


Mechanics

For typical data entry and storage, data usually appear in ''flat'' tables, meaning that they consist of only columns and rows, as in the following portion of a sample spreadsheet showing data on shirt types: While tables such as these can contain many data items, it can be difficult to get summarized information from them. A pivot table can help quickly summarize the data and highlight the desired information. The usage of a pivot table is extremely broad and depends on the situation. The first question to ask is, "What am I seeking?" In the example here, let us ask, "How many ''Units'' did we sell in each ''Region'' for every ''Ship Date?''": A pivot table usually consists of ''row'', ''column'' and ''data'' (or ''fact'') fields. In this case, the column is ''ship date'', the row is ''region'' and the data we would like to see is (sum of) ''units''. These fields allow several kinds of aggregations, including: sum, average,
standard deviation In statistics, the standard deviation is a measure of the amount of variation or dispersion of a set of values. A low standard deviation indicates that the values tend to be close to the mean (also called the expected value) of the set, whil ...
, count, etc. In this case, the total number of units shipped is displayed here using a ''sum'' aggregation.


Implementation

Using the example above, the software will find all distinct values for ''Region''. In this case, they are: ''North'', ''South'', ''East'', ''West''. Furthermore, it will find all distinct values for ''Ship Date''. Based on the aggregation type, ''sum'', it will summarize the fact, the quantities of ''Unit'', and display them in a multidimensional chart. In the example above, the first datum is 66. This number was obtained by finding all records where both ''Region'' was ''East'' and ''Ship Date'' was ''1/31/2005'', and adding the ''Units'' of that collection of records (''i.e.'', cells E2 to E7) together to get a final result. Pivot tables are not created automatically. For example, in Microsoft Excel one must first select the entire data in the original table and then go to the Insert tab and select "Pivot Table" (or "Pivot Chart"). The user then has the option of either inserting the pivot table into an existing sheet or creating a new sheet to house the pivot table. A pivot table field list is provided to the user which lists all the column headers present in the data. For instance, if a table represents sales data of a company, it might include Date of sale, Salesperson, Item sold, Color of the item, Units sold, Per unit price, and total price. This makes the data more readily accessible. The fields that would be created will be visible on the right hand side of the worksheet. By default, the pivot table layout design will appear below this list. Pivot Table fields are the building blocks of pivot tables. Each of the fields from the list can be dragged on to this layout, which has four options: # Filters # Columns # Rows # Values Some uses of pivot tables are related to the analysis of questionnaires with optional responses but some implementations of pivot tables do not allow these use cases. For example the implementation in LibreOffice Calc since
2012 File:2012 Events Collage V3.png, From left, clockwise: The passenger cruise ship Costa Concordia lies capsized after the Costa Concordia disaster; Damage to Casino Pier in Seaside Heights, New Jersey as a result of Hurricane Sandy; People gat ...
is not able to process empty cells.


Filters

Report filter is used to apply a filter to an entire table. For example, if the "Color of Item" field is dragged to this area, then the table constructed will have a report filter inserted above the table. This report filter will have drop-down options (Black, Red, and White in the example above). When an option is chosen from this
drop-down list A drop-down list (abbreviated drop-down, or DDL; also known as a drop-down menu, drop menu, pull-down list, picklist) is a graphical control element, similar to a list box, that allows the user to choose one value from a list. When a drop-dow ...
("Black" in this example), then the table that would be visible will contain only the data from those rows that have the "Color of Item= Black".


Columns

Column labels are used to apply a filter to one or more columns that have to be shown in the pivot table. For instance if the "Salesperson" field is dragged to this area, then the table constructed will have values from the column "Sales Person", ''i.e.'', one will have a number of columns equal to the number of "Salesperson". There will also be one added column of Total. In the example above, this instruction will create five columns in the table — one for each salesperson, and Grand Total. There will be a filter above the data — column labels — from which one can select or deselect a particular salesperson for the pivot table. This table will not have any numerical values as no numerical field is selected but when it is selected, the values will automatically get updated in the column of "Grand total".


Rows

Row labels are used to apply a filter to one or more rows that have to be shown in the pivot table. For instance, if the "Salesperson" field is dragged on this area then the other output table constructed will have values from the column "Salesperson", ''i.e.'', one will have a number of rows equal to the number of "Sales Person". There will also be one added row of "Grand Total". In the example above, this instruction will create five rows in the table — one for each salesperson, and Grand Total. There will be a filter above the data — row labels — from which one can select or deselect a particular salesperson for the Pivot table. This table will not have any numerical values, as no numerical field is selected, but when it is selected, the values will automatically get updated in the Row of "Grand Total".


Values

This usually takes a field that has numerical values that can be used for different types of calculations. However, using text values would also not be wrong; instead of Sum, it will give a count. So, in the example above, if the "Units sold" field is dragged to this area along with the row label of "Salesperson", then the instruction will add a new column, "Sum of units sold", which will have values against each salesperson.


Application support

Pivot tables or pivot functionality are an integral part of many spreadsheet applications and some database software, as well as being found in other data visualization tools and
business intelligence Business intelligence (BI) comprises the strategies and technologies used by enterprises for the data analysis and management of business information. Common functions of business intelligence technologies include reporting, online analytical ...
packages.


Spreadsheets

*
Microsoft Excel Microsoft Excel is a spreadsheet developed by Microsoft for Microsoft Windows, Windows, macOS, Android (operating system), Android and iOS. It features calculation or computation capabilities, graphing tools, pivot tables, and a macro (comp ...
supports PivotTables, which can be visualized through PivotCharts. * Apache POI * LibreOffice Calc and Openoffice Calc support pivot tables. Prior to version 3.4, this feature was named "DataPilot". *
Calligra Sheets Calligra Sheets (formerly ''KSpread'' and ''Calligra Tables'') is a free software spreadsheet application that is part of Calligra Suite, an integrated graphic art and office suite developed by KDE. Among Sheets’ features are multiple sheets ...
supports pivot tables. *
Google Sheets Google Sheets is a spreadsheet program included as part of the free, web-based Google Docs Editors suite offered by Google. The service also includes: Google Docs, Google Slides, Google Drawings, Google Forms, Google Sites and Google Keep. G ...
natively supports pivot tables. * Numbers, from Apple Inc., gained pivot table support in version 11.2.


Database support

*
PostgreSQL PostgreSQL (, ), also known as Postgres, is a free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance. It was originally named POSTGRES, referring to its origins as a successor to the ...
, an object–relational database management system, allows the creation of pivot tables using the ''tablefunc'' module. *
MariaDB MariaDB is a community-developed, commercially supported fork of the MySQL relational database management system (RDBMS), intended to remain free and open-source software under the GNU General Public License. Development is led by some of the ori ...
, a MySQL fork, allows pivot tables using the CONNECT storage engine. *
Microsoft Access Microsoft Access is a database management system (DBMS) from Microsoft that combines the relational Access Database Engine (ACE) with a graphical user interface and software-development tools (not to be confused with the old Microsoft Access ...
supports pivot queries under the name "crosstab" query. *
Microsoft SQL Server Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which ...
supports pivot as of SQL Server 2016 with the FROM...PIVOT keywords *
Oracle Database Oracle Database (commonly referred to as Oracle DBMS, Oracle Autonomous Database, or simply as Oracle) is a multi-model database management system produced and marketed by Oracle Corporation. It is a database commonly used for running online ...
supports the PIVOT operation. * Some popular databases that do not directly support pivot functionality, such as
SQLite SQLite (, ) is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the mo ...
, can usually simulate pivot functionality using embedded functions, dynamic SQL or subqueries. The issue with pivoting in such cases is usually that the number of output columns must be known at the time the query starts to execute; for pivoting this is not possible as the number of columns is based on the data itself. Therefore, the names must be hard coded or the query to be executed must itself be created dynamically (meaning, prior to each use) based upon the data.


Web applications

* ZK, an Ajax framework, also allows the embedding of pivot tables in Web applications.


Programming languages and libraries

*Programming languages and libraries suited to work with tabular data contain functions that allow the creation and manipulation of pivot tables. Python data analysis toolkit pandas has the function ''pivot_table'', and the ''xs'' method useful to obtain sections of pivot tables. While R has the
Tidyverse The tidyverse is a collection of open source packages for the R programming language introduced by Hadley Wickham and his team that "share an underlying design philosophy, grammar, and data structures" of tidy data. Characteristic features of t ...
metapackage, which contains a collection of tools providing pivot table functionality, as well as the pivottabler package.


Online analytical processing

Excel pivot tables include the feature to directly query an
online analytical processing Online analytical processing, or OLAP (), is an approach to answer multi-dimensional analytical (MDA) queries swiftly in computing. OLAP is part of the broader category of business intelligence, which also encompasses relational databases, repor ...
(OLAP) server for retrieving data instead of getting the data from an Excel spreadsheet. On this configuration, a pivot table is a simple client of an OLAP server. Excel's PivotTable not only allows for connecting to Microsoft's Analysis Service, but to any XML for Analysis (XMLA) OLAP standard-compliant server.


See also


References


Further reading

*''A Complete Guide to PivotTables: A Visual Approach'' () 
in-depth review at slashdot.org
*''Excel 2007 PivotTables and PivotCharts: Visual blueprint'' () *''Pivot Table Data Crunching'' (Business Solutions) () *''Beginning Pivot Tables in Excel 2007'' ({{ISBN, 1-59059-890-3) Data analysis Infographics Microsoft Office Spreadsheet software 1991 introductions