Class PivotFilter

透視篩選器

存取及修改資料透視表篩選器。

方法

方法傳回類型簡短說明
getFilterCriteria()FilterCriteria傳回此樞紐篩選器的篩選條件。
getPivotTable()PivotTable傳回此篩選器所屬的 PivotTable
getSourceDataColumn()Integer傳回這個篩選器要處理的來源資料欄數量。
getSourceDataSourceColumn()DataSourceColumn傳回篩選器運作的資料來源欄。
remove()void從資料透視表中移除這個資料透視篩選器。
setFilterCriteria(filterCriteria)PivotFilter設定樞紐篩選器的篩選條件。

內容詳盡的說明文件

getFilterCriteria()

傳回此樞紐篩選器的篩選條件。

回攻員

FilterCriteria:樞紐篩選器的篩選條件

授權

使用這個方法的腳本需要具備下列一或多個範圍的授權:

  • 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:篩選器運作的資料來源欄。

授權

使用這個方法的腳本需要具備下列一或多個範圍的授權:

  • 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

setFilterCriteria(filterCriteria)

設定樞紐篩選器的篩選條件。

參數

名稱類型說明
filterCriteriaFilterCriteria要設定的篩選條件。

回攻員

PivotFilter:用於鏈結的樞紐篩選器

授權

使用這個方法的腳本需要具備下列一或多個範圍的授權:

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