What Is Pivot?
A Pivot Table is a data summarization tool that automatically sorts, counts, totals, or averages data stored in one table and displays the results in a second, organized table.
In RevoGrid, the Pivot plugin takes a “flat” list of records and transforms it into a multidimensional view where you can see relationships between different data points at a glance.
The Transformation: From Facts to Insights
Section titled “The Transformation: From Facts to Insights”Imagine you have a list of sales transactions. Each row represents a single event:
| Date | Region | Category | Sales |
|---|---|---|---|
| 2024-01-01 | North | Electronics | $500 |
| 2024-01-02 | South | Electronics | $300 |
| 2024-01-03 | North | Furniture | $1,200 |
| 2024-01-04 | North | Electronics | $450 |
This “flat” view is great for data entry, but hard to read for analysis. A Pivot transforms it by choosing axes:
- Row Axis: Grouping data vertically (e.g., by Region).
- Column Axis: Grouping data horizontally (e.g., by Category).
- Values: The numbers you want to calculate (e.g., Sum of Sales).
The Resulting Pivot View:
Section titled “The Resulting Pivot View:”| Region | Electronics | Furniture | Grand Total |
|---|---|---|---|
| North | $950 | $1,200 | $2,150 |
| South | $300 | $0 | $300 |
| Grand Total | $1,250 | $1,200 | $2,450 |
Core Axes of a Pivot
Section titled “Core Axes of a Pivot”To work with Pivot, you need to think in terms of three primary axes:
1. Rows (The Hierarchy)
Section titled “1. Rows (The Hierarchy)”Rows define the vertical structure. If you add multiple fields to rows (e.g., ['Region', 'Manager']), Pivot creates a nested hierarchy. Users can “drill down” from Region to see the individual Managers within that region.
2. Columns (The Breakdown)
Section titled “2. Columns (The Breakdown)”Columns define the horizontal structure. Unlike normal grid columns, Pivot columns are often generated based on the data. If you put Quarter in columns, Pivot will automatically create a column for every unique quarter found in your dataset.
3. Values (The Measures)
Section titled “3. Values (The Measures)”Values are the “meat” of the table. They are the numeric fields that get crunched using Aggregators (like sum, avg, min, max, or count). Every cell in a Pivot table is the result of an aggregation of all raw records that match that specific row and column intersection.
Why Use RevoGrid Pivot?
Section titled “Why Use RevoGrid Pivot?”- Massive Data: RevoGrid’s virtualization allows you to pivot millions of rows without crashing the browser.
- Dynamic Discovery: Users can drag and drop fields to explore data from different angles.
- Enterprise Features: Subtotals, Grand Totals, and Drill-down are built-in and optimized.
- Server-Side Scaling: For datasets too large for the browser, RevoGrid can connect to an OLAP Backend to perform the heavy lifting on the server while maintaining a smooth UI.
Next Steps
Section titled “Next Steps”To understand how these concepts map to actual code, read about Dimensions or explore the Mental Model in the Overview.