ExcelScript.ValueFilterCondition enum
Enum representing all accepted conditions by which a value filter can be applied. Used to configure the type of PivotFilter that is applied to the field. PivotFilter.exclusive
can be set to true
to invert many of these conditions.
Remarks
Examples
/**
* This script applies a PivotValueFilter to the first row hierarchy in the PivotTable.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the PivotTable on the current worksheet.
let sheet = workbook.getActiveWorksheet();
let pivotTable = sheet.getPivotTables()[0];
// Get the first row hierarchy to use as the field which gets filtered.
let rowHierarchy = pivotTable.getRowHierarchies()[0];
// Get the first data hierarchy to use as the values for filtering the rows.
let dataHierarchy = pivotTable.getDataHierarchies()[0];
// Create a filter that excludes values greater than 500.
let filter: ExcelScript.PivotValueFilter = {
condition: ExcelScript.ValueFilterCondition.greaterThan,
comparator: 500,
value: dataHierarchy.getName()
};
// Apply the filter.
rowHierarchy.getPivotField(rowHierarchy.getName()).applyFilter({
valueFilter: filter
});
}
Fields
between | Between Required Criteria: { |
bottomN | In bottom N ( Required Criteria: { |
equals | Equals comparator criterion. Required Criteria: { |
greaterThan | Greater than comparator criterion. Required Criteria: { |
greaterThanOrEqualTo | Greater than or equal to comparator criterion. Required Criteria: { |
lessThan | Less than comparator criterion. Required Criteria: { |
lessThanOrEqualTo | Less than or equal to comparator criterion. Required Criteria: { |
topN | In top N ( Required Criteria: { |
unknown |
|