Excel.LabelFilterCondition enum

ラベル フィルターを適用できるすべての受け入れ可能な条件を表す列挙型。 フィールドに適用されるピボットフィルターの種類を構成するために使用します。 PivotFilter.criteria.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 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"

ラベルは部分文字列の条件で始まります。

必須条件: {substring}。 オプションの条件: {exclusive}

between = "Between"

lowerBoundupperBound の条件の間。

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

contains = "Contains"

Label contains substring criterion.

必須条件: {substring}。 オプションの条件: {exclusive}

endsWith = "EndsWith"

ラベルの末尾は部分文字列の条件です。

必須条件: {substring}。 オプションの条件: {exclusive}

equals = "Equals"

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

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

greaterThan = "GreaterThan"

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

必須条件: {comparator}

greaterThanOrEqualTo = "GreaterThanOrEqualTo"

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

必須条件: {comparator}

lessThan = "LessThan"

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

必須条件: {comparator}

lessThanOrEqualTo = "LessThanOrEqualTo"

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

必須条件: {comparator}

unknown = "Unknown"

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