This is an old revision of the document!


What is a Pivot Table?

A lot of definitions can be found in the web. More deeper information can be found In Wikipedia

Simple we can say that pivot table is a program tool that allows you to reorganize and summarize
selected columns and rows of data in a spreadsheet or database table to obtain a desired report.
A pivot table doesn't actually change the spreadsheet or database itself. In database lingo, to
pivot is to turn the data to view it from different perspectives.

What is jqPivotGrid?

jqPivotGrid is a component that you can use with jqGrid to create a pivot grid.
Let’s say that we have the following table with some sales data with the following fields:
product name, category name, country, price and quantity. If you want to edit, search delete this data,
you could easily use jqGrid features.

What would you do if you had to answer the following questions?

  1. What are the order amounts of each category?
  2. What are the order amounts of each in a specific country?
  3. What are the order amounts and quantity of each category and product in specific country and their totals?

You could use jqPivotGrid to create those reports, and this is how they would look:

Using jqPivotGrid

jqPivotGrid inherits the jqGrid, so you can use most of the features you are already
familiar with: column resizing, formatter, cell renderers, row/cell events etc.
The jqPivotGrid can be used when you want to get summation and pivot features that aren’t
provided in the jqGrid.

To break down the dataset into categories and country, you just have to configure the x and y Dimentions:

xDimension : [{
    dataName: 'CategoryName'
}],
yDimension : [ {
    dataName: 'Country'
}]

Multiple levels are supported, so you can just specify them in the y and x Dimensions.
Grouping the rows and/or columns is done automatically when two or more levels are set in
xDimension and/or yDimension.

Now that you broke down the dataset on the y and x Dimension, it’s time to aggregate
the cell values. Several kinds of aggregations are available including:
sum, min, max, count etc. Future release will provide your own aggregation function.

aggregates : [{
    member : 'Price', 
    aggregator : 'sum', 
    width:50,
    label:'Sum'
},{
    member : 'Quantity', 
    aggregator : 'count', 
    width:50, 
    label: 'Count'
}]
You could leave a comment if you were logged in.

QR Code
QR Code wiki:pivotdescription (generated for current page)