存取及修改資料透視表。
方法
| 方法 | 傳回類型 | 簡短說明 | 
|---|---|---|
| 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
在資料透視表中建立新的透視值,該值是根據指定的 formula 和指定的 name 計算而得。
參數
| 名稱 | 類型 | 說明 | 
|---|---|---|
| name | String | 這個計算樞紐值的名稱。 | 
| formula | String | 用來計算這個值的公式。 | 
回攻員
Pivot:新建立的 Pivot
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
- 
https://www.googleapis.com/auth/spreadsheets.currentonly
- 
https://www.googleapis.com/auth/spreadsheets
add
在資料透視表中定義新的樞紐資料欄群組。指定的 source 會指出這個分組所依據的來源資料欄。
參數
| 名稱 | 類型 | 說明 | 
|---|---|---|
| source | Integer | 這個群組匯總的欄數。這個索引代表試算表中資料欄的絕對編號, 1代表資料欄「A」,2代表資料欄 B,以此類推。 | 
回攻員
Pivot:新建立的 Pivot
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
- 
https://www.googleapis.com/auth/spreadsheets.currentonly
- 
https://www.googleapis.com/auth/spreadsheets
add
為資料透視表建立新的資料透視篩選器。指定的 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
使用指定的 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
在資料透視表中定義新的資料透視列群組。指定的 source 會指出這個分組所依據的來源資料欄。
參數
| 名稱 | 類型 | 說明 | 
|---|---|---|
| source | Integer | 這個群組匯總的欄數。這個索引代表試算表中資料欄的絕對編號, 1代表資料欄「A」,2代表資料欄 B,以此類推。 | 
回攻員
Pivot:新建立的 Pivot
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
- 
https://www.googleapis.com/auth/spreadsheets.currentonly
- 
https://www.googleapis.com/auth/spreadsheets
as
如果資料透視表已連結至 Data,則會傳回資料透視表做為資料來源資料透視表;如果未連結,則會傳回 null。
回攻員
Data:資料來源資料透視表。
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
- 
https://www.googleapis.com/auth/spreadsheets.currentonly
- 
https://www.googleapis.com/auth/spreadsheets
get
get
傳回這個資料透視表中資料欄群組的排序清單。
回攻員
Pivot:這個資料透視表中的欄群組
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
- 
https://www.googleapis.com/auth/spreadsheets.currentonly
- 
https://www.googleapis.com/auth/spreadsheets
get
傳回這個樞紐分析表中的篩選器排序清單。
回攻員
Pivot:這個資料透視表中的篩選器
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
- 
https://www.googleapis.com/auth/spreadsheets.currentonly
- 
https://www.googleapis.com/auth/spreadsheets
get
傳回這個資料透視表中資料透視值的排序清單。
回攻員
Pivot:這個資料透視表中的資料透視值
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
- 
https://www.googleapis.com/auth/spreadsheets.currentonly
- 
https://www.googleapis.com/auth/spreadsheets
get
傳回這個資料透視表中列群組的排序清單。
回攻員
Pivot:這個資料透視表中的列群組
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
- 
https://www.googleapis.com/auth/spreadsheets.currentonly
- 
https://www.googleapis.com/auth/spreadsheets
get
get
remove()
刪除這個資料透視表。對這個資料透視表進行其他作業會導致錯誤。
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
- 
https://www.googleapis.com/auth/spreadsheets.currentonly
- 
https://www.googleapis.com/auth/spreadsheets
set
將資料透視表的版面配置設為以欄或列的形式顯示值。
參數
| 名稱 | 類型 | 說明 | 
|---|---|---|
| dimension | Dimension | 指示樞紐值顯示方式的維度。 | 
回攻員
Pivot:用於鏈結的資料透視表
授權
使用這個方法的腳本需要具備下列一或多個範圍的授權:
- 
https://www.googleapis.com/auth/spreadsheets.currentonly
- 
https://www.googleapis.com/auth/spreadsheets