/
Pivot Table Macro 1.1

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

Cloud version

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 tablestring  
Type of Calculation *Function (count, sum, average) used to calculate the values of the Pivot Tableenumcountcount, sum, average
RowsColumn name of the body table(s) used to feed the rows of the Pivot table.string  
ColumnsColumn name of the body table(s) used to feed the columns of the Pivot tablestring  
Display Grand Total for RowsAdd 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 emptybooleanfalse 
Display Grand Total for ColumnsAdd 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 emptybooleanfalse 
Display Body TablesThe body table(s) can be displayed 'before' or 'after' the Pivot tableenum before, after

Using the Pivot Table Macro

To add the Pivot Table macro to a page:

  1. Edit the page
  2. Prepare a table with an heading row and some data in it. (See Screenshot 1 below)
  3. Use autocomplete to add the Pivot Table macro. (Type '{pivot-table}')
  4. Insert a column name in the Values parameter corresponding to a column of your table
  5. 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)
  6. Click Save to add the Pivot Table macro to your page.
  7. Move your table in the body of the Pivot Table macro  (See Screenshot 3 below)
  8. Click the Pivot Table placeholder and choose Edit.
  9. Click Refresh in the 'Preview' area, to check that the pivot table appears as you expect. (See Screenshot 4 below)
  10. Change the Type Of Calculation parameter value to sum
  11. Click Refresh in the 'Preview' area, to check that the pivot table sums now the values. (See Screenshot 5 below)
  12. Insert a column name in the Rows  parameter corresponding to a column of your table
  13. 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)
  14. Click Save to add the Pivot Table macro to your page.
  15. 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 SaleSales PersonItem SoldColor of ItemUnits SoldPer Unit PriceTotal Price
10/01/2013ImranNotebookBlack825000200000
10/01/2013ImranLaptopBlack1824000432000
10/02/2013LarryLaptopRed435000140000
10/03/2013ImranMouseRed68505100
10/04/2013LarryNotebookWhite1027000270000
10/05/2013LarryMouseBlack4832
10/05/2013ImranMouseWhite20081600

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
Key
Value
Values (*)Per Unit Price
Type of Calculation (*)sum
Pivot Table
Date of Sale
Sales Person
Item Sold
Color of Item
Units Sold
Per Unit Price
Total Price
10/01/2013ImranNotebookBlack825000200000
10/01/2013ImranLaptopBlack1824000432000
10/02/2013LarryLaptopRed435000140000
10/03/2013ImranMouseRed68505100
10/04/2013LarryNotebookWhite1027000270000
10/05/2013LarryMouseBlack4832
10/05/2013ImranMouseWhite20081600
Sum of Per Unit Price
111866

Pivot Table with row

 

Parameters in Macro Browser
Data in Macro Placeholder
Rendered data
Key
Value
Values (*)Per Unit Price
Type of Calculation (*)sum
RowsSales Person
Pivot Table
Date of Sale
Sales Person
Item Sold
Color of Item
Units Sold
Per Unit Price
Total Price
10/01/2013ImranNotebookBlack825000200000
10/01/2013ImranLaptopBlack1824000432000
10/02/2013LarryLaptopRed435000140000
10/03/2013ImranMouseRed68505100
10/04/2013LarryNotebookWhite1027000270000
10/05/2013LarryMouseBlack4832
10/05/2013ImranMouseWhite20081600
Sales PersonSum of Per Unit Price
Imran49858
Larry62008
   

 

Pivot Table with column and row

 

Parameters in Macro Browser
Data in Macro Placeholder
Rendered data
Key
Value
Values (*)Per Unit Price
Type of Calculation (*)average
RowsSales Person
ColumnsColor of Item
Pivot Table
Date of Sale
Sales Person
Item Sold
Color of Item
Units Sold
Per Unit Price
Total Price
10/01/2013ImranNotebookBlack825000200000
10/01/2013ImranLaptopBlack1824000432000
10/02/2013LarryLaptopRed435000140000
10/03/2013ImranMouseRed68505100
10/04/2013LarryNotebookWhite1027000270000
10/05/2013LarryMouseBlack4832
10/05/2013ImranMouseWhite20081600
Average of Per Unit PriceBlackRedWhite
Imran245008508
Larry83500027000

Pivot Table nested within Chart Macro

Parameters in Macro Browser
Data in Macro Placeholder
Rendered data
Key
Value
Typebar
Show shapestrue
Show Legend?true
Forgivetrue
Chart
Pivot Table
Date of Sale
Sales Person
Item Sold
Color of Item
Units Sold
Per Unit Price
Total Price
10/01/2013ImranNotebookBlack825000200000
10/01/2013ImranLaptopBlack1824000432000
10/02/2013LarryLaptopRed435000140000
10/03/2013ImranMouseRed68505100
10/04/2013LarryNotebookWhite1027000270000
10/05/2013LarryMouseBlack4832
10/05/2013ImranMouseWhite20081600

JIRA macro nested within Pivot Table 

Parameters in Macro Browser
Data in Macro Placeholder
Rendered datas
Key
Value
Values (*)Key
Type of Calculation (*)count
RowsAssignee
ColumnsStatus
Pivot Table
JIRA
Count of Key
Done
In Progress
To Do
Seuqra11 
admin 12

JIRA macro nested within Pivot Table nested within Chart Macro

Parameters in Macro Browser
Data in Macro Placeholder
Rendered datas
Key
Value
Typebar
Show shapestrue
Show Legend?true
Forgivetrue
Chart
Pivot Table
JIRA

Related content