Returns the number of the source data column this filter operates on. These indices are
1-based, for example if this filter applies to data in column A of the spreadsheet this method
returns "1."
Return
Integer — The number of the source data column this filter applies to.
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
[[["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 2025-08-12 UTC."],[[["\u003cp\u003e\u003ccode\u003ePivotFilter\u003c/code\u003e objects provide methods to access and modify filters applied to pivot tables in Google Sheets.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve filter criteria, identify the associated pivot table and source data column, and remove the filter using dedicated methods.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003esetFilterCriteria()\u003c/code\u003e method allows you to define specific filtering conditions for the pivot table data.\u003c/p\u003e\n"],["\u003cp\u003eThese methods require authorization with specific scopes to interact with Google Sheets data.\u003c/p\u003e\n"]]],[],null,["PivotFilter\n\nAccess and modify pivot table filters. \n\nMethods\n\n| Method | Return type | Brief description |\n|-------------------------------------------------------------------------|---------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|\n| [getFilterCriteria()](#getFilterCriteria()) | [FilterCriteria](/apps-script/reference/spreadsheet/filter-criteria) | Returns the filter criteria for this pivot filter. |\n| [getPivotTable()](#getPivotTable()) | [PivotTable](/apps-script/reference/spreadsheet/pivot-table) | Returns the [PivotTable](/apps-script/reference/spreadsheet/pivot-table) that this filter belongs to. |\n| [getSourceDataColumn()](#getSourceDataColumn()) | `Integer` | Returns the number of the source data column this filter operates on. |\n| [getSourceDataSourceColumn()](#getSourceDataSourceColumn()) | [DataSourceColumn](/apps-script/reference/spreadsheet/data-source-column) | Returns the data source column the filter operates on. |\n| [remove()](#remove()) | `void` | Removes this pivot filter from the pivot table. |\n| [setFilterCriteria(filterCriteria)](#setFilterCriteria(FilterCriteria)) | [PivotFilter](#) | Sets the filter criteria for this pivot filter. |\n\nDetailed documentation \n\n`get``Filter``Criteria()` \nReturns the filter criteria for this pivot filter.\n\nReturn\n\n\n[FilterCriteria](/apps-script/reference/spreadsheet/filter-criteria) --- the filter criteria for this pivot filter\n\nAuthorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n`get``Pivot``Table()` \nReturns the [PivotTable](/apps-script/reference/spreadsheet/pivot-table) that this filter belongs to.\n\nReturn\n\n\n[PivotTable](/apps-script/reference/spreadsheet/pivot-table) --- the pivot table this filter belongs to\n\nAuthorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n`get``Source``Data``Column()` \nReturns the number of the source data column this filter operates on. These indices are\n1-based, for example if this filter applies to data in column A of the spreadsheet this method\nreturns \"1.\"\n\nReturn\n\n\n`Integer` --- the number of the source data column this filter applies to\n\nAuthorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n`get``Source``Data``Source``Column()` \nReturns the data source column the filter operates on. Returns `null` if the pivot table\nis not a {DataSourcePivotTableApi}.\n\nReturn\n\n\n[DataSourceColumn](/apps-script/reference/spreadsheet/data-source-column) --- The data source column the filter operates on.\n\nAuthorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n`remove()` \nRemoves this pivot filter from the pivot table.\n\nAuthorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`\n\n*** ** * ** ***\n\n`set``Filter``Criteria(filterCriteria)` \nSets the filter criteria for this pivot filter.\n\nParameters\n\n| Name | Type | Description |\n|--------------------|----------------------------------------------------------------------|-----------------------------|\n| `filter``Criteria` | [FilterCriteria](/apps-script/reference/spreadsheet/filter-criteria) | The filter criteria to set. |\n\nReturn\n\n\n[PivotFilter](#) --- the pivot filter for chaining\n\nAuthorization\n\nScripts that use this method require authorization with one or more of the following [scopes](/apps-script/concepts/scopes#setting_explicit_scopes):\n\n- `https://www.googleapis.com/auth/spreadsheets.currentonly`\n- `https://www.googleapis.com/auth/spreadsheets`"]]