次の方法で共有


ExcelScript.LabelFilterCondition enum

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

注釈

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

フィールド

beginsWith

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

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

between

と 条件のupperBoundlowerBound

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

contains

ラベルには、部分文字列の条件が含まれています。

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

endsWith

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

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

equals

比較条件に等しい。

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

greaterThan

比較条件より大きい。

必須の条件: {comparator}

greaterThanOrEqualTo

比較条件以上。

必須の条件: {comparator}

lessThan

比較条件より小さい。

必須の条件: {comparator}

lessThanOrEqualTo

比較条件以下。

必須の条件: {comparator}

unknown

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