ExcelScript.LabelFilterCondition enum
表示可应用标签筛选器的所有接受条件的枚举。 用于配置应用于字段的 PivotFilter 的类型。 PivotFilter.criteria.exclusive
可以设置为 以 true
反转其中许多条件。
注解
示例
/**
* This script filters items that start with "L" from the "Type" field
* of the "Farm Sales" PivotTable.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the PivotTable.
const pivotTable = workbook.getActiveWorksheet().getPivotTable("Farm Sales");
// Get the "Type" field.
const field = pivotTable.getHierarchy("Type").getPivotField("Type");
// Filter out any types that start with "L" (such as "Lemons" and "Limes").
const filter: ExcelScript.PivotLabelFilter = {
condition: ExcelScript.LabelFilterCondition.beginsWith,
substring: "L",
exclusive: true
};
// Apply the label filter to the field.
field.applyFilter({ labelFilter: filter });
}
字段
beginsWith | 标签以子字符串条件开头。 必需条件:{ |
between | 在 和 必需条件: { |
contains | 标签包含子字符串条件。 必需条件:{ |
endsWith | 标签以子字符串条件结尾。 必需条件:{ |
equals | 等于比较器条件。 必需条件:{ |
greaterThan | 大于比较器条件。 必需条件:{ |
greaterThanOrEqualTo | 大于或等于比较器条件。 必需条件:{ |
lessThan | 小于比较器条件。 必需条件:{ |
lessThanOrEqualTo | 小于或等于比较器条件。 必需条件:{ |
unknown |
|
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈