ExcelScript.FilterPivotHierarchy interface

Excel FilterPivotHierarchy を表します。

注釈

/**
 * This script creates a PivotTable with a filter.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get the two worksheets to use in PivotTable creation.
  const dataSheet = workbook.getWorksheet("Data");
  const pivotSheet = workbook.getWorksheet("Pivot");

  // Create a new PivotTable.
  const newPivot = pivotSheet.addPivotTable(
    "My PivotTable", 
    dataSheet.getUsedRange(), 
    pivotSheet.getRange("A1"));

  // Add a filter with the Quarter field.
  const filter: ExcelScript.FilterPivotHierarchy = 
    newPivot.addFilterHierarchy(newPivot.getHierarchy("Quarter"));

  // Add other hierarchies...
}

メソッド

getEnableMultipleFilterItems()

複数のフィルター項目を許可するかどうかを指定します。

getFields()

FilterPivotHierarchy に関連付けられているピボット フィールドを返します。

getId()

FilterPivotHierarchy の ID。

getName()

FilterPivotHierarchy の名前。

getPivotField(name)

名前で PivotField を取得します。 PivotField が存在しない場合、このメソッドは を返します undefined

getPosition()

FilterPivotHierarchy の位置。

setEnableMultipleFilterItems(enableMultipleFilterItems)

複数のフィルター項目を許可するかどうかを指定します。

setName(name)

FilterPivotHierarchy の名前。

setPosition(position)

FilterPivotHierarchy の位置。

setToDefault()

FilterPivotHierarchy を既定値にリセットします。

メソッドの詳細

getEnableMultipleFilterItems()

複数のフィルター項目を許可するかどうかを指定します。

getEnableMultipleFilterItems(): boolean;

戻り値

boolean

getFields()

FilterPivotHierarchy に関連付けられているピボット フィールドを返します。

getFields(): PivotField[];

戻り値

getId()

FilterPivotHierarchy の ID。

getId(): string;

戻り値

string

getName()

FilterPivotHierarchy の名前。

getName(): string;

戻り値

string

/**
 * This script logs the names of all the filter hierarchies in a PivotTable.
 */
function main(workbook: ExcelScript.Workbook) {
    // Get the first PivotTable in the workbook.
    const pivotTable = workbook.getPivotTables()[0];

    // For each pivot filter, log its name.
    pivotTable.getFilterHierarchies().forEach((filter: ExcelScript.FilterPivotHierarchy) => {
      console.log(filter.getName());
    });
}

getPivotField(name)

名前で PivotField を取得します。 PivotField が存在しない場合、このメソッドは を返します undefined

getPivotField(name: string): PivotField | undefined;

パラメーター

name

string

取得する PivotField の名前。

戻り値

getPosition()

FilterPivotHierarchy の位置。

getPosition(): number;

戻り値

number

setEnableMultipleFilterItems(enableMultipleFilterItems)

複数のフィルター項目を許可するかどうかを指定します。

setEnableMultipleFilterItems(enableMultipleFilterItems: boolean): void;

パラメーター

enableMultipleFilterItems

boolean

戻り値

void

setName(name)

FilterPivotHierarchy の名前。

setName(name: string): void;

パラメーター

name

string

戻り値

void

setPosition(position)

FilterPivotHierarchy の位置。

setPosition(position: number): void;

パラメーター

position

number

戻り値

void

setToDefault()

FilterPivotHierarchy を既定値にリセットします。

setToDefault(): void;

戻り値

void