存取及修改資料透視表。
方法
| 方法 | 傳回類型 | 簡短說明 |
|---|---|---|
add | Pivot | 在資料透視表中建立新的透視值,該值是根據指定 formula 和 name 計算而得。 |
add | Pivot | 在資料透視表中定義新的透視欄分組。 |
add | Pivot | 為資料透視表建立新的資料透視篩選器。 |
add | Pivot | 在資料透視表中,使用指定的 summarize 定義新的資料透視值。 |
add | Pivot | 在資料透視表中定義新的資料透視列分組。 |
as | Data | 如果資料透視表已連結至 Data,則傳回資料透視表做為資料來源資料透視表,否則傳回 null。 |
get | Range | 傳回代表這個資料透視表錨定儲存格的 Range。 |
get | Pivot | 傳回這個資料透視表中的資料欄群組排序清單。 |
get | Pivot | 傳回這個樞紐分析表中的篩選器排序清單。 |
get | Pivot | 傳回這份資料透視表中的資料透視值排序清單。 |
get | Pivot | 傳回這個資料透視表中的列群組排序清單。 |
get | Range | 傳回資料透視表所依據的來源資料範圍。 |
get | Dimension | 傳回值是否顯示為資料列或資料欄。 |
remove() | void | 刪除這個資料透視表。 |
set | Pivot | 設定這個資料透視表的版面配置,以欄或列的形式顯示值。 |
內容詳盡的說明文件
add Calculated Pivot Value(name, formula)
在資料透視表中建立新的透視值,該值是根據指定 formula 和 name 計算而得。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
name | String | 這個計算樞紐值的名稱。 |
formula | String | 計算這個值的公式。 |
回攻員
Pivot:新建立的 Pivot
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
add Column Group(sourceDataColumn)
在資料透視表中定義新的透視欄分組。指定的 source 代表這個分組依據的來源資料欄。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
source | Integer | 這個群組匯總的欄數。這個索引代表試算表中的絕對欄數;1 代表「A」欄,2 代表 B 欄,依此類推。 |
回攻員
Pivot:新建立的 Pivot
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
add Filter(sourceDataColumn, filterCriteria)
為資料透視表建立新的資料透視篩選器。指定的 source
表示篩選器要處理的來源資料欄。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
source | Integer | 這個群組匯總的欄數。這個索引代表試算表中的絕對欄數;1 代表「A」欄,2 代表 B 欄,依此類推。 |
filter | Filter | 用於執行篩選作業的篩選條件。 |
回攻員
Pivot:新建立的 Pivot
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
add Pivot Value(sourceDataColumn, summarizeFunction)
在資料透視表中,使用指定的 summarize 定義新的資料透視值。指定 source:指出這個值所依據的來源資料欄。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
source | Integer | 這個群組匯總的欄數。這個索引代表試算表中的絕對欄數;1 代表「A」欄,2 代表 B 欄,依此類推。 |
summarize | Pivot |
回攻員
Pivot:新建立的 Pivot
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
add Row Group(sourceDataColumn)
在資料透視表中定義新的資料透視列分組。指定的 source 代表這個分組依據的來源資料欄。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
source | Integer | 這個群組匯總的欄數。這個索引代表試算表中的絕對欄數;1 代表「A」欄,2 代表 B 欄,依此類推。 |
回攻員
Pivot:新建立的 Pivot
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
as Data Source Pivot Table()
如果資料透視表已連結至 Data,則傳回資料透視表做為資料來源資料透視表,否則傳回 null。
回攻員
Data - 資料來源資料透視表。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get Anchor Cell()
get Column Groups()
傳回這個資料透視表中的資料欄群組排序清單。
回攻員
Pivot:這個資料透視表中的欄群組
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get Filters()
傳回這個樞紐分析表中的篩選器排序清單。
回攻員
Pivot:這個資料透視表中的篩選器
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get Pivot Values()
傳回這份資料透視表中的資料透視值排序清單。
回攻員
Pivot:這份資料透視表中的資料透視值
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get Row Groups()
傳回這個資料透視表中的列群組排序清單。
回攻員
Pivot:這個資料透視表中的列群組
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get Source Data Range()
get Values Display Orientation()
remove()
刪除這個資料透視表。對這個資料透視表執行進一步作業時會發生錯誤。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
set Values Display Orientation(dimension)
設定這個資料透視表的版面配置,以欄或列的形式顯示值。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
dimension | Dimension | 指出如何顯示樞紐分析表值的維度。 |
回攻員
Pivot:用於串連的樞紐資料表
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets