Excel.PivotLabelFilter interface

PivotField に適用するラベル フィルター用の構成可能なテンプレート。 conditionは、フィルターを動作させるために設定する必要がある条件を定義します。

注釈

[ API セット: ExcelApi 1.12 ]

// 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();
});

プロパティ

comparator

コンパレータは、他の値が比較される静的な値です。 比較の種類は条件によって定義されます。 注: 数値文字列は、他の数値文字列と比較されるときに数値として扱われます。

condition

必要なフィルター条件を定義するフィルターの条件を指定します。

exclusive

true 場合、フィルターは条件を満たす項目を除外します。 既定値は false です (条件を満たす項目を含むようにフィルター処理します)。

lowerBound

betweenフィルター条件の範囲の下限。 注: 数値文字列は、他の数値文字列と比較されるときに数値として扱われます。

substring

beginsWith endsWith、およびcontainsフィルター条件に使用される部分文字列。

upperBound

between フィルター条件の範囲の上限。 注: 数値文字列は、他の数値文字列と比較されるときに数値として扱われます。

プロパティの詳細

comparator

コンパレータは、他の値が比較される静的な値です。 比較の種類は条件によって定義されます。 注: 数値文字列は、他の数値文字列と比較されるときに数値として扱われます。

comparator?: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.12 ]

condition

必要なフィルター条件を定義するフィルターの条件を指定します。

condition: Excel.LabelFilterCondition | "Unknown" | "Equals" | "BeginsWith" | "EndsWith" | "Contains" | "GreaterThan" | "GreaterThanOrEqualTo" | "LessThan" | "LessThanOrEqualTo" | "Between";

プロパティ値

Excel.LabelFilterCondition | "Unknown" | "Equals" | "BeginsWith" | "EndsWith" | "Contains" | "GreaterThan" | "GreaterThanOrEqualTo" | "LessThan" | "LessThanOrEqualTo" | "Between"

注釈

[ API セット: ExcelApi 1.12 ]

exclusive

true 場合、フィルターは条件を満たす項目を除外します。 既定値は false です (条件を満たす項目を含むようにフィルター処理します)。

exclusive?: boolean;

プロパティ値

boolean

注釈

[ API セット: ExcelApi 1.12 ]

lowerBound

betweenフィルター条件の範囲の下限。 注: 数値文字列は、他の数値文字列と比較されるときに数値として扱われます。

lowerBound?: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.12 ]

substring

beginsWith endsWith、およびcontainsフィルター条件に使用される部分文字列。

substring?: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.12 ]

upperBound

between フィルター条件の範囲の上限。 注: 数値文字列は、他の数値文字列と比較されるときに数値として扱われます。

upperBound?: string;

プロパティ値

string

注釈

[ API セット: ExcelApi 1.12 ]