Excel.LabelFilterCondition enum
ラベル フィルターを適用できるすべての受け入れ可能な条件を表す列挙型。 フィールドに適用されるピボットフィルターの種類を構成するために使用します。
PivotFilter.criteria.exclusive
true に設定すると、こうした条件の多くを反転できます。
注釈
使用元
例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/38-pivottable/pivottable-pivotfilters.yaml
await Excel.run(async (context) => {
// Add a PivotFilter to filter based on the strings of item labels.
// Get the PivotTable.
const pivotTable = context.workbook.worksheets.getActiveWorksheet().pivotTables.getItem("Farm Sales");
// Get the "Type" field.
const field = pivotTable.hierarchies.getItem("Type").fields.getItem("Type");
// Filter out any types that start with "L" ("Lemons" and "Limes" in this case).
const filter: Excel.PivotLabelFilter = {
condition: Excel.LabelFilterCondition.beginsWith,
substring: "L",
exclusive: true
};
// Apply the label filter to the field.
field.applyFilter({ labelFilter: filter });
await context.sync();
});
フィールド
| beginsWith = "BeginsWith" | ラベルは部分文字列の条件で始まります。 必須条件: { |
| between = "Between" |
必須条件: { |
| contains = "Contains" | Label contains substring criterion. 必須条件: { |
| endsWith = "EndsWith" | ラベルの末尾は部分文字列の条件です。 必須条件: { |
| equals = "Equals" | コンパレーター条件と等しくなります。 必須条件: { |
| greaterThan = "GreaterThan" | コンパレーターの条件より大きい。 必須条件: { |
| greaterThanOrEqualTo = "GreaterThanOrEqualTo" | コンパレーター条件以上。 必須条件: { |
| lessThan = "LessThan" | コンパレーターの条件より小さい。 必須条件: { |
| lessThanOrEqualTo = "LessThanOrEqualTo" | コンパレーターの条件以下。 必須条件: { |
| unknown = "Unknown" |
|