Pivot table

A pivot table is a table of values which are aggregations of groups of individual values from a more extensive table (such as from a database, spreadsheet, or business intelligence program) within one or more discrete categories. The aggregations or summaries of the groups of the individual terms might include sums, averages, counts, or other statistics. A pivot table is the outcome of the statistical processing of tabularized raw data and can be used for decision-making.

Although pivot table is a generic term, Microsoft held a trademark on the term in the United States from 1994 to 2020.[1]

History

In their book Pivot Table Data Crunching,[2] Bill Jelen and Mike Alexander refer to Pito Salas as the "father of pivot tables". While working on a concept for a new program that would eventually become Lotus Improv, 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 released Improv in 1991 on the NeXT platform. A few months after the release of Improv, Brio Technology published a standalone Macintosh implementation, called DataPivot (with technology eventually patented in 1999).[3] Borland purchased the DataPivot technology in 1992 and implemented it in their own spreadsheet application, Quattro Pro.

In 1993 the Microsoft Windows version of Improv appeared. Early in 1994 Microsoft Excel 5[4] 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 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 11g.[5]

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:

A B C D E F G
1 Region Gender Style Ship date Units Price Cost
2 East Boy Tee 2005-01-31 12 11.04 10.42
3 East Boy Golf 2005-01-31 12 13.00 12.60
4 East Boy Fancy 2005-01-31 12 11.96 11.74
5 East Girl Tee 2005-01-31 10 11.27 10.56
6 East Girl Golf 2005-01-31 10 12.12 11.95
7 East Girl Fancy 2005-01-31 10 13.74 13.33
8 West Boy Tee 2005-01-31 11 11.44 10.94
9 West Boy Golf 2005-01-31 11 12.63 11.73
10 West Boy Fancy 2005-01-31 11 12.06 11.51
11 West Girl Tee 2005-01-31 15 13.42 13.29
12 West Girl Golf 2005-01-31 15 11.48 10.67

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?":

Sum of units Ship date ▼
Region ▼ 2005-01-31 2005-02-28 2005-03-31 2005-04-30 2005-05-31 2005-06-30
East 66 80 102 116 127 125
North 96 117 138 151 154 156
South 123 141 157 178 191 202
West 78 97 117 136 150 157
(blank)
Grand total 363 435 514 581 622 640

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, 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 2005-01-31, 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, Sales person, Item sold, Color of item, Units sold, Per unit price, and Total price. This makes the data more readily accessible.

Date of sale Sales person Item sold Color of item Units sold Per unit price Total price
2013-10-01 Jones Notebook Black 8 25000 200000
2013-10-02 Prince Laptop Red 4 35000 140000
2013-10-03 George Mouse Red 6 850 5100
2013-10-04 Larry Notebook White 10 27000 270000
2013-10-05 Jones Mouse Black 4 700 2800
A LibreOffice Calc pivot table and its dialog with inspected fields circled

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:

  1. Filters
  2. Columns
  3. Rows
  4. 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 is not able to process empty cells.[6][7]

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 ("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.

Row labels Sum of units sold
Jones 12
Prince 4
George 6
Larry 10
Grand total 32

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 packages.

Spreadsheets

Database support

  • PostgreSQL, an object–relational database management system, allows the creation of pivot tables using the tablefunc module.[13]
  • MariaDB, a MySQL fork, allows pivot tables using the CONNECT storage engine.[14]
  • Microsoft Access supports pivot queries under the name "crosstab" query. [citation needed]
  • Microsoft SQL Server supports pivot as of SQL Server 2016 with the FROM...PIVOT keywords[15]
  • Oracle Database supports the PIVOT operation.[citation needed]
  • Some popular databases that do not directly support pivot functionality, such as SQLite, 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.[citation needed]

Web applications

  • ZK, an Ajax framework, also allows the embedding of pivot tables in Web applications.[citation needed]

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[16] and the xs method useful to obtain sections of pivot tables.[citation needed]
  • R has the Tidyverse metapackage, which contains a collection of tools providing pivot table functionality,[17][18] as well as the pivottabler package.[19]

Online analytical processing

Excel pivot tables include the feature to directly query an online analytical processing (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

  1. ^ "United States Trademark Serial Number 74472929". December 27, 1994. Retrieved March 23, 2022.
  2. ^ Jelen, Bill; Alexander, Michael (2006). Pivot table data crunching. Indianapolis: Que. pp. 274. ISBN 0-7897-3435-4.
  3. ^ Gartung, Daniel L.; Edholm, Yorgen H.; Edholm, Kay-Martin; McNall, Kristen N.; Lew, Karl M., Patent #5915257, retrieved February 16, 2010
  4. ^ Darlington, Keith (August 6, 2012). VBA For Excel Made Simple. Routledge (published 2012). p. 19. ISBN 9781136349775. Retrieved September 10, 2014. [...] Excel 5, released in early 1994, included the first version of VBA.
  5. ^ Shah, Sharanam; Shah, Vaishali (2008). Oracle for Professionals – Covers Oracle 9i, 10g and 11g. Shroff Publishing Series. Navi Mumbai: Shroff Publishers (published July 2008). p. 549. ISBN 9788184045260. Retrieved September 10, 2014. One of the most useful new features of the Oracle Database 11g from the SQL perspective is the introduction of Pivot and Unpivot operators.
  6. ^ "LibreOffice Calc and Pivot table with empty cells". StackOverflow. June 17, 2021. Retrieved June 17, 2021.
  7. ^ "Functionality request for PIVOTTABLE". LibreOffice bugs. March 19, 2012. Retrieved June 17, 2021.
  8. ^ Dalgleish, Debra (2007). Beginning PivotTables in Excel 2007: From Novice to Professional. Apress. pp. 233–257. ISBN 9781430204336. Retrieved September 18, 2018.
  9. ^ "Busy Developers' Guide to HSSF and XSSF Features". poi.apache.org. Retrieved December 9, 2022.
  10. ^ "Pivot Tables".
  11. ^ "Create & use pivot tables". Docs Editors Help. Google Inc. Retrieved August 6, 2020.
  12. ^ "iWork update brings major changes to Mac, iPhone, and iPad apps". Macworld. Retrieved September 28, 2021.
  13. ^ "PostgreSQL: Documentation: 9.2: tablefunc". postgresql.org. November 9, 2017.
  14. ^ "CONNECT Table Types – PIVOT Table Type". mariadb.com.
  15. ^ "FROM clause plus JOIN, APPLY, PIVOT (T-SQL) – SQL Server".
  16. ^ "pandas.pivot_table". Retrieved November 21, 2023.
  17. ^ dplyr and Pivot Tables.
  18. ^ Pivoting.
  19. ^ "pivottabler".

Further reading

Read other articles:

  لمعانٍ أخرى، طالع الحورة (توضيح). الحورة (محلة) تقسيم إداري البلد  اليمن المحافظة محافظة إب المديرية مديرية السبرة العزلة عزلة عينان القرية قرية القفل السكان التعداد السكاني 2004 السكان 146   • الذكور 84   • الإناث 62   • عدد الأسر 21   • عدد المساكن 23 معلومات أخ...

 

American mystery crime drama television series This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: The Law & Harry McGraw – news · newspapers · books · scholar · JSTOR (April 2016) (Learn how and when to remove this template message) The Law & Harry McGrawGenre Crime drama Police procedural Mystery Creat...

 

Thomas StreetClockwise from top: the spire of the Church of St. Augustine and St. John; the Guinness brewery; businesses along Thomas StreetNative nameSráid Thomáis (Irish)NamesakeSt. Thomas's Church (named for Thomas Becket)Length600 m (2,000 ft)Width12 metres (39 ft)LocationDublin, IrelandPostal codeD08Coordinates53°20′35″N 6°16′51″W / 53.34306°N 6.28083°W / 53.34306; -6.28083west endJames's Streeteast endCornmarket, St. Au...

Valencia West Plaats in de Verenigde Staten Vlag van Verenigde Staten Locatie van Valencia West in Arizona Locatie van Arizona in de VS Situering County Pima County Type plaats Census-designated place Staat Arizona Coördinaten 32° 8′ NB, 111° 7′ WL Algemeen Oppervlakte 24,9 km² - land 24,9 km² - water 0,0 km² Inwoners (2000) 2.380 Overig FIPS-code 78760 Portaal    Verenigde Staten Valencia West is een plaats (census-designated place) in de Amerikaanse staat Arizona...

 

Association football club in Belgium Football clubCercle Brugge KSVFull nameCercle BruggeKoninklijke SportverenigingNickname(s)Groen en Zwart (Green and Black), De VerenigingFounded1899; 124 years ago (1899)GroundJan Breydel Stadium, BrugesCapacity29,062OwnerDmitry RybolovlevManagerMiron MuslicLeagueBelgian Pro League2022–23Belgian Pro League, 6th of 18WebsiteClub website Home colours Away colours Current season Cercle Brugge Koninklijke Sportvereniging (Dutch pronunciatio...

 

El Ford Escort es un automóvil del segmento C producido entre 1980 y 2003. Fue el primer auto de tracción delantera de Ford en los Estados Unidos, siendo lanzado en 1981 para sustituir al Ford Pinto así como al Ford Fiesta importado. Primera generación Ford Escort (primera generación) Datos generalesOtros nombres Mercury LynxFabricante FordPeríodo 1980–1990 (Escort)1980–1987 (Lynx)ConfiguraciónTipo Automóvil de turismoSegmento Segmento CCarrocerías Hatchback tres y cinco puertasF...

?Cirroteuthis muelleri Спостереження Cirroteuthis muelleri під час експедиції Arctic 2005 Exploration Охоронний статус Найменший ризик (МСОП 3.1)[1] Біологічна класифікація Домен: Еукаріоти (Eukaryota) Царство: Тварини (Animalia) Тип: Молюски (Mollusca) Клас: Головоногі (Cephalopoda) Ряд: Восьминоги (Octopoda) Родина: Cirroteut...

 

Tremor of Intent: An Eschatological Spy Novel First edition (publ. Heinemann)AuthorAnthony BurgessCountryUnited KingdomLanguageEnglishGenreSpy novelPublication date1966Media typePrintPages256 Tremor of Intent: An Eschatological Spy Novel (1966), by Anthony Burgess, is an English espionage novel.[1][2] Burgess conceived it as a reaction both to the heavy-handed and humourless spy fiction of John le Carré, and to Ian Fleming's James Bond, a character Burgess thought an imp...

 

Artistic style of the Iberian peninsula Mozarabic arches in the Church of Santiago de Peñalba (El Bierzo, Spain) Mozarabic art refers to art of Mozarabs (from musta'rab meaning Arabized), Iberian Christians living in Al-Andalus, the Muslim conquered territories in the period that comprises from the Arab invasion of the Iberian Peninsula (711) to the end of the 11th century, adopted some Arab customs without converting to Islam, preserving their religion and some ecclesiastical and judicial a...

HongeohoeNama KoreaHangul홍어회 Hanja洪魚膾 Alih Aksarahongeohoe Hongeohoe adalah salah satu jenis hoe dalam masakan Korea berupa irisan sejenis ikan pari (Rajiformes, bahasa Korea: hongeo) yang dihidangkan dalam keadaan mentah. Irisan daging ikan bisa dari ikan pari segar atau ikan pari yang sudah difermentasi. Hidangan ini biasanya dimakan bersama gochujang. Ikan pari dimasukkan ke dalam guci sebelum diletakkan di tempat gelap dan sejuk untuk difermentasi selama kira-kira 10 hari. Set...

 

Station of the Istanbul Metro This article relies largely or entirely on a single source. Relevant discussion may be found on the talk page. Please help improve this article by introducing citations to additional sources.Find sources: Kirazlı Istanbul Metro – news · newspapers · books · scholar · JSTOR (June 2016) KirazlıIstanbul Metro rapid transit complexThe M3 platform.General informationCoordinates41°01′52″N 28°50′31″E / &#...

 

Hungarian mosaicist and stained glass artist Miksa RóthBorn26 December 1865 Died14 June 1944  (aged 78)Budapest Resting placeTörökbálint  Miksa Róth (26 December 1865 – 14 June 1944) was a Hungarian mosaicist and stained glass artist responsible for making mosaic and stained glass prominent art forms in Hungarian art.[1][2] In part, Róth was inspired by the work of Pre-Raphaelite artists Edward Burne-Jones and William Morris.[2] Róth ap...

Architectural style in the US Not to be confused with Federation architecture. Central Pavilion at Tontine Crescent in Boston, built in 1793–94 Elfreth's Alley in Philadelphia, featuring Colonial and Federal-style homes, is believed to be the nation's oldest residential street.[1] Federal Hill mansion, built in 1795, at My Old Kentucky Home State Park in Bardstown, Kentucky Old Town Hall in Salem, Massachusetts, built in 1816–17 Hamilton Hall, built in 1805 by Samuel McIntire in S...

 

Planting technique Hydroseeding being carried out at the Isle of Grain, Kent, UK A commercial hydroseeder Hydroseeding (or hydraulic mulch seeding, hydro-mulching, hydraseeding) is a planting process that uses a slurry of seed and mulch. It is often used as an erosion control technique on construction sites, as an alternative to the traditional process of broadcasting or sowing dry seed.[1] Description The hydroseeding slurry is transported in a tank, either truck-mounted or trailer-m...

 

French subscription video streaming service SaltoType of businessJoint ventureType of siteOTT video streaming platformAvailable inFrenchDissolvedMarch 27, 2023; 8 months ago (March 27, 2023)HeadquartersBoulogne-Billancourt, Île-de-France, FranceCountry of originFranceArea servedFranceOwner France Télévisions (33%) TF1 Group (33%) Groupe M6 (33%) URLsalto.fr at the Wayback Machine (archived January 28, 2023)RegistrationRequiredUsers 800 000 (as of January 18,...

Demographics of LibyaPopulation pyramid of Libya in 2020Population7,137,931 (2022 est.)Growth rate1.65% (2022 est.)Birth rate21.56 births/1,000 populationDeath rate3.45 deaths/1,000 populationLife expectancy73.29 years • male70.27 years • female76.11 yearsFertility rate3.09 childrenInfant mortality rate5.22 deaths/1,000 live birthsNet migration rate1.61 migrant(s)/1,000 populationSex ratioTotal1.04 male(s)/female (2022 est.)At birth1.05 male(s)/femaleNationalityNationa...

 

Documentary web series by Shane Dawson This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: The Secret World of Jeffree Star – news · newspapers · books · scholar · JSTOR (October 2019) (Learn how and when to remove this template message) The Secret World of Jeffree StarGenre Reality television Documentary series...

 

凯特·谢泼德1905年的凯特·谢泼德原文名Kate Sheppard出生凯瑟琳·威尔逊·马尔科姆Catherine Wilson Malcolm(1848-03-10)1848年3月10日 英國利物浦逝世1934年7月13日(1934歲—07—13)(87歲) 新西兰基督城知名于争取妇女参政权配偶沃尔特·谢泼德 (1871年結婚;1915年逝世)威廉·洛弗尔-史密斯 (1925年結婚)儿女道格拉斯·谢泼德 (1880年—1910年)亲属妹:伊莎贝拉·梅(英语:Isabella May...

United States historic placeClark Brothers Factory No. 1U.S. National Register of Historic Places Factory complex, 1988Show map of ConnecticutShow map of the United StatesLocation1331 S. Main St., Southington, ConnecticutCoordinates41°34′15″N 72°53′47″W / 41.57083°N 72.89639°W / 41.57083; -72.89639Area4.7 acres (1.9 ha)Built1893 (1893)Architectural styleIndustrial vernacularMPSHistoric Industrial Complexes of Southington TRNRHP reference...

 

تاساخت تقسيم إداري البلد المغرب  الجهة درعة تافيلالت الإقليم زاكورة الدائرة أكدز الجماعة القروية تازارين المشيخة آيت والال السكان التعداد السكاني 81 نسمة (إحصاء 2004)   • عدد الأسر 11 معلومات أخرى التوقيت ت ع م±00:00 (توقيت قياسي)[1]،  وت ع م+01:00 (توقيت صيفي)[1]  تعد...

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!