ExcelScript.PivotFilterType enum

A simple enum that represents a type of filter for a PivotField.

Remarks

Examples

/**
 * This script gets the "Type" field from the "Farms Sales" PivotTable 
 * and clears the value filter from it.
 */ 
function main(workbook: ExcelScript.Workbook) {
  // Get the PivotTable named "Farm Sales".
  const pivot = workbook.getPivotTable("Farm Sales");

  // Get the "Type" field.
  const typeField = pivot.getHierarchy("Type").getPivotField("Type");

  // Clear the value filter (if there is one) from the field.
  typeField.clearFilter(ExcelScript.PivotFilterType.value);
}

Fields

date

Filters PivotItems with a date in place of a label. Note: A PivotField cannot simultaneously have a label filter and a date filter applied.

label

Filters PivotItems based on their labels. Note: A PivotField cannot simultaneously have a label filter and a date filter applied.

manual

Filters specific manually selected PivotItems from the PivotTable.

unknown

PivotFilterType is unknown or unsupported.

value

Filters based on the value of a PivotItem with respect to a DataPivotHierarchy.