次の方法で共有


ExcelScript.ValueFilterCondition enum

値フィルターを適用できる、受け入れられるすべての条件を表す列挙型。 フィールドに適用される PivotFilter の種類を構成するために使用します。 PivotFilter.exclusive を に true 設定して、これらの条件の多くを反転させることができます。

注釈

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

フィールド

between

と 条件のupperBoundlowerBound

必須条件: {value、、upperBoundlowerBound}。 オプションの条件: {exclusive}

bottomN

下の N (threshold) [items, percent, sum] の値カテゴリ。

必須条件: {value、、selectionTypethreshold}

equals

比較条件に等しい。

必須の条件: {value, comparator}. オプションの条件: {exclusive}

greaterThan

比較条件より大きい。

必須の条件: {value, comparator}.

greaterThanOrEqualTo

比較条件以上。

必須の条件: {value, comparator}.

lessThan

比較条件より小さい。

必須の条件: {value, comparator}.

lessThanOrEqualTo

比較条件以下。

必須の条件: {value, comparator}.

topN

値カテゴリの上位 N (threshold) [items, percent, sum] で。

必須条件: {value、、selectionTypethreshold}

unknown

ValueFilterCondition が不明であるか、サポートされていません。