Class PivotValue

透視

存取及修改資料透視表中的值群組。

方法

方法傳回類型簡短說明
getDisplayType()PivotValueDisplayType傳回顯示類型,說明這個樞紐分析表值目前在表格中的顯示方式。
getFormula()String傳回用於計算這個值的公式。
getPivotTable()PivotTable傳回這個值所屬的 PivotTable
getSourceDataColumn()Integer傳回資料透視值匯總的來源資料欄數量。
getSourceDataSourceColumn()DataSourceColumn|null傳回資料透視值匯總的資料來源資料欄。
getSummarizedBy()PivotTableSummarizeFunction傳回這個群組的摘要函式。
remove()void從樞紐分析表中移除這個值。
setDisplayName(name)PivotValue設定樞紐分析表中這個值的顯示名稱。
setFormula(formula)PivotValue設定用於計算這個值的公式。
showAs(displayType)PivotValue在樞紐分析表中,將這個值顯示為另一個值的函式。
summarizeBy(summarizeFunction)PivotValue設定摘要函式。

內容詳盡的說明文件

getDisplayType()

傳回顯示類型,說明這個樞紐分析表值目前在表格中的顯示方式。

回攻員

PivotValueDisplayType - 這個樞紐值的顯示類型

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getFormula()

傳回用於計算這個值的公式。如果這個值不是計算欄位,這個方法會傳回 null

回攻員

String:用於串連的樞紐值

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getPivotTable()

傳回這個值所屬的 PivotTable

回攻員

PivotTable:這個值所屬的資料透視表

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getSourceDataColumn()

傳回資料透視值彙整的來源資料欄數量。這個索引是以 1 為基準,如果這個群組會彙整試算表「A」欄中的來源資料,這個方法會傳回 1

回攻員

Integer - 來源資料欄編號。

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getSourceDataSourceColumn()

傳回資料透視值匯總的資料來源資料欄。如果資料透視表不是 {DataSourcePivotTableApi},則傳回 null

回攻員

DataSourceColumn|null:資料透視值匯總的來源資料來源資料欄。

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

getSummarizedBy()

傳回這個群組的摘要函式。

回攻員

PivotTableSummarizeFunction:群組的摘要函式

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

remove()

從樞紐分析表中移除這個值。

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setDisplayName(name)

設定樞紐分析表中這個值的顯示名稱。

參數

名稱類型說明
nameString要設定的顯示名稱。

回攻員

PivotValue:用於串連的樞紐值

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

setFormula(formula)

設定用來計算這個值的公式。如果這個值不是計算欄位,這個方法就會導致錯誤。

參數

名稱類型說明
formulaString用來計算這個值的公式。

回攻員

PivotValue:用於串連的樞紐值

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

showAs(displayType)

在樞紐分析表中,將這個值顯示為另一個值的函式。

參數

名稱類型說明
displayTypePivotValueDisplayType顯示值的方式。

回攻員

PivotValue:用於串連的樞紐值

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets

summarizeBy(summarizeFunction)

設定摘要函式。

參數

名稱類型說明
summarizeFunctionPivotTableSummarizeFunction用來匯總此值來源資料欄中資料的函式。

回攻員

PivotValue:用於串連的樞紐值

授權

使用這個方法的指令碼需要一或多個下列範圍的授權:

  • https://www.googleapis.com/auth/spreadsheets.currentonly
  • https://www.googleapis.com/auth/spreadsheets