PivotLabelTotal (Object)

Member of:

SideLabel object, TopLabel object

Description:

Returns an additional row or column containing the total for a top label or side label object. This is like selecting a pivot side label column or top label row and selecting Add Totals from the Pivot menu.

Tip:

All collections have the “Item(NameOrIndex)” method. This is the default method for all collections that returns collection items at a particular index or by name. Use brackets ([]) to represent calls to the Item (Method). For example, these statements are identical: myItem = Documents[1] myItem = Documents.Item(1) myItem = Documents["StartUp.bqy"] myItem = Documents.Item("StartUp.bqy")

Example 1:

This example shows how to add a Totals column (using the default data function of “sum”) for the “Product Line” from the Totals collection or from the TopLabels collection:

ActiveDocument.Sections["SalesPivot"].TopLabels["Product Line"].Totals.Add()
or
ActiveDocument.Sections["SalesPivot"].TopLabels["Product Line"].AddTotals()

Example 2:

This example shows how to determine the average using the data function property and the totals collection:

ActiveDocument.Sections["SalesPivot"].TopLabels["Product Line"].Totals[1]. DataFunction=bqDataFunctionAverage
ActiveDocument.Sections["SalesPivot"].TopLabels["Product Line"].Totals.Add()

Methods:

Remove

Properties:

Read-write: Property DataFunction as BqDataFunction