Stay organized with collections Save and categorize content based on your preferences.
PivotValueAccess and modify value groups in pivot tables.
Detailed documentationgetDisplayType()
Returns the display type describing how this pivot value is currently displayed in the table.
ReturnPivotValueDisplayType
— the display type for this pivot value
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
getFormula()
Returns the formula used to calculate this value. If this value is not a calculated field this method returns null
.
String
— the pivot value for chaining
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
getPivotTable()
Returns the PivotTable
which this value belongs to.
PivotTable
— the pivot table this value belongs to
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
getSourceDataColumn()
Returns the number of the source data column the pivot value summarizes. This index is 1-based, if this group summarizes source data in column "A" of the spreadsheet this method returns 1
.
Integer
— The source data column number.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
getSourceDataSourceColumn()
Returns the data source column the pivot value summarizes. Returns null
if the pivot table is not a {DataSourcePivotTableApi}.
DataSourceColumn
— The source data source column the pivot value summarizes.
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
getSummarizedBy()
Returns this group’s summarization function.
ReturnPivotTableSummarizeFunction
— the group's summarization function
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
remove()
Remove this value from the pivot table.
AuthorizationScripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
setDisplayName(name)
Sets the display name for this value in the pivot table.
Parameters Name Type Descriptionname
String
The display name to set. Return
PivotValue
— the pivot value for chaining
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
setFormula(formula)
Sets the formula used to calculate this value. If this value is not a calculated field this method results in an error.
Parameters Name Type Descriptionformula
String
The formula to use to calculate this value. Return
PivotValue
— the pivot value for chaining
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
showAs(displayType)
Displays this value in the pivot table as a function of another value.
Parameters ReturnPivotValue
— the pivot value for chaining
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
summarizeBy(summarizeFunction)
Sets the summarization function.
Parameters Name Type DescriptionsummarizeFunction
PivotTableSummarizeFunction
The function to use to summarize data in this value's source data column. Return
PivotValue
— the pivot value for chaining
Scripts that use this method require authorization with one or more of the following scopes:
https://www.googleapis.com/auth/spreadsheets.currentonly
https://www.googleapis.com/auth/spreadsheets
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-03 UTC."],[[["`PivotValue` provides methods to access and modify value groups within Google Sheets pivot tables."],["You can use these methods to control the display, calculation, summarization, and source data of pivot values."],["`PivotValue` methods enable customization of how data is presented and aggregated within the pivot table."],["These methods allow you to programmatically change the appearance and behavior of value groups in pivot tables."]]],["PivotValue allows access and modification of value groups in pivot tables. Key actions include retrieving information such as the display type, formula, associated pivot table, source data column number, data source column, and summarization function. You can set the display name, define or change the calculation formula, specify how the value is displayed relative to another value, set summarization functions, and remove the value. The methods also return information such as the current display type, the calculation formula used, etc.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4