Pivot Table Macro 1.1
On this page:
Overview
The Pivot Table macro allows you to display a pivot table based on tabular data.
This macro can be easily nested within the Chart Macro to display a chart based on the pivot table generated from your tabular data.
JIRA macro can also be nested within the Pivot Table macro.
Availability
Parameters
The below table has been automatically generated by Macro Documentation Helpers add-on.
Name | Description | Type | Default Value | Possible Values |
---|---|---|---|---|
Values * | Column name of the body table(s) used to feed the values of the Pivot table | string | ||
Type of Calculation * | Function (count, sum, average) used to calculate the values of the Pivot Table | enum | count | count, sum, average |
Rows | Column name of the body table(s) used to feed the rows of the Pivot table. | string | ||
Columns | Column name of the body table(s) used to feed the columns of the Pivot table | string | ||
Display Grand Total for Rows | Add a Grand Total column in the Pivot Table and compute a total for each row. This parameter is taken into account only if Rows parameter is not empty | boolean | false | |
Display Grand Total for Columns | Add a Grand Total row in the Pivot Table and compute a total for each column. This parameter is taken into account only if Columns parameter is not empty | boolean | false | |
Display Body Tables | The body table(s) can be displayed 'before' or 'after' the Pivot table | enum | before, after |
Using the Pivot Table Macro
To add the Pivot Table macro to a page:
- Edit the page
- Prepare a table with an heading row and some data in it. (See Screenshot 1 below)
- Use autocomplete to add the Pivot Table macro. (Type '{pivot-table}')
- Insert a column name in the Values parameter corresponding to a column of your table
- Click Refresh in the 'Preview' area. The message "Please insert a table in the body" is displayed. It's because there is no data in the macro body yet (See Screenshot 2 below)
- Click Save to add the Pivot Table macro to your page.
- Move your table in the body of the Pivot Table macro (See Screenshot 3 below)
- Click the Pivot Table placeholder and choose Edit.
- Click Refresh in the 'Preview' area, to check that the pivot table appears as you expect. (See Screenshot 4 below)
- Change the Type Of Calculation parameter value to sum
- Click Refresh in the 'Preview' area, to check that the pivot table sums now the values. (See Screenshot 5 below)
- Insert a column name in the Rows parameter corresponding to a column of your table
- Click Refresh in the 'Preview' area, to check that the pivot table presents the sum of Values Parameter per Rows parameter. (See Screenshot 6 below)
- Click Save to add the Pivot Table macro to your page.
- Click Save again when you are ready to save the page.
Screenshot 1: Example of a table with an heading row and some data in it
Date of Sale | Sales Person | Item Sold | Color of Item | Units Sold | Per Unit Price | Total Price |
---|---|---|---|---|---|---|
10/01/2013 | Imran | Notebook | Black | 8 | 25000 | 200000 |
10/01/2013 | Imran | Laptop | Black | 18 | 24000 | 432000 |
10/02/2013 | Larry | Laptop | Red | 4 | 35000 | 140000 |
10/03/2013 | Imran | Mouse | Red | 6 | 850 | 5100 |
10/04/2013 | Larry | Notebook | White | 10 | 27000 | 270000 |
10/05/2013 | Larry | Mouse | Black | 4 | 8 | 32 |
10/05/2013 | Imran | Mouse | White | 200 | 8 | 1600 |
Screenshot 2: Missing table body message
Screenshot 3: Populate the Pivot Table macro body with a table
Screenshot 4: Pivot Table retrieved 7 records in the body table for column Per Unit Price
Screenshot 5: Pivot Table summed Per Unit Price column
Screenshot 6: Pivot Table: Sum of Per Unit Price column per Sales Person
Examples
All the examples below have been automatically generated by Macro Documentation Helpers add-on.
Pivot Table without column and row
Parameters in Macro Browser | Data in Macro Placeholder | Rendered data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
Pivot Table with row
Parameters in Macro Browser | Data in Macro Placeholder | Rendered data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pivot Table with column and row
Parameters in Macro Browser | Data in Macro Placeholder | Rendered data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
Pivot Table nested within Chart Macro
Parameters in Macro Browser | Data in Macro Placeholder | Rendered data | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
JIRA macro nested within Pivot Table
Parameters in Macro Browser | Data in Macro Placeholder | Rendered datas | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
|
JIRA macro nested within Pivot Table nested within Chart Macro
Parameters in Macro Browser | Data in Macro Placeholder | Rendered datas | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|