Excel.ValueFilterCondition enum

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

注釈

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 on the values correlated with a row.

  // Get the PivotTable.
  const pivotTable = context.workbook.worksheets.getActiveWorksheet().pivotTables.getItem("Farm Sales");

  // Get the "Farm" field.
  const field = pivotTable.hierarchies.getItem("Farm").fields.getItem("Farm");

  // Filter to only include rows with more than 500 wholesale crates sold.
  const filter: Excel.PivotValueFilter = {
    condition: Excel.ValueFilterCondition.greaterThan,
    comparator: 500,
    value: "Sum of Crates Sold Wholesale"
  };

  // Apply the value filter to the field.
  field.applyFilter({ valueFilter: filter });

  await context.sync();
});

フィールド

between = "Between"

lowerBoundupperBound の条件の間。

必須条件: {value, lowerBound, upperBound}。 オプションの条件: {exclusive}

bottomN = "BottomN"

値カテゴリの下位 N (threshold) [アイテム、パーセント、合計]。

必須条件: {value, threshold, selectionType}

equals = "Equals"

コンパレーター条件と等しくなります。

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

greaterThan = "GreaterThan"

コンパレーターの条件より大きい。

必須条件: {value, comparator}

greaterThanOrEqualTo = "GreaterThanOrEqualTo"

コンパレーター条件以上。

必須条件: {value, comparator}

lessThan = "LessThan"

コンパレーターの条件より小さい。

必須条件: {value, comparator}

lessThanOrEqualTo = "LessThanOrEqualTo"

コンパレーターの条件以下。

必須条件: {value, comparator}

topN = "TopN"

値カテゴリの上位 N (threshold) [アイテム、パーセント、合計]。

必須条件: {value, threshold, selectionType}

unknown = "Unknown"

ValueFilterCondition 不明またはサポートされていません。