次の方法で共有


ExcelScript.PivotLabelFilter interface

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

注釈

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

プロパティ

condition

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

exclusive

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

lowerBound

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

substring

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

upperBound

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

プロパティの詳細

condition

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

condition: LabelFilterCondition;

プロパティ値

exclusive

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

exclusive?: boolean;

プロパティ値

boolean

lowerBound

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

lowerBound?: string;

プロパティ値

string

substring

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

substring?: string;

プロパティ値

string

upperBound

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

upperBound?: string;

プロパティ値

string