> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Types: OfficeJS: PivotTables and slicers

## `ConsolidationFunction`

`ST_DataConsolidateFunction`; VBA's `XlConsolidationFunction`.

Import from `@reductoai/xlsx/officejs`.

```ts theme={null}
type ConsolidationFunction = "sum" | "count" | "average" | "max" | "min" | "product" | "countNums" | "stdDev" | "stdDevp" | "var" | "varp"
```

## `PivotAxis`

Not exported by name. You get it from the API.

```ts theme={null}
type PivotAxis = "Unknown" | "Row" | "Column" | "Data" | "Filter"
```

## `PivotEditor`

What the layout and hierarchy handles read and edit through.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `fieldFilters` | `(fld: number) => FieldFilterSpec[]` | |
| `fieldLayout` | `(fld: number) => FieldLayout` | |
| `fields` | `() => string[]` | |
| `filter` | `(fld: number) => PivotFieldFilter` | |
| `filterKinds` | `(fld: number) => PivotFilterKind[]` | |
| `flags` | `() => PivotFlags` | |
| `group` | `(fld: number, g: PivotGroupOptions \| null, items?: string[]) => void` | |
| `grouping` | `(fld: number) => PivotGrouping \| null` | |
| `info` | `() => PivotInfo` | |
| `items` | `(fld: number) => Scalar[]` | |
| `setExpanded` | `(fld: number, items: Scalar[] \| null, on: boolean) => void` | |
| `setFieldFilter` | `(fld: number, kind: FieldFilterKind \| "All", spec: FieldFilterSpec \| null) => void` | |
| `setFieldLayout` | `(fld: number, o: Partial<FieldLayout>) => void` | |
| `setFilter` | `(fld: number, visible: Scalar[] \| null) => void` | |
| `setFlags` | `(patch: Partial<PivotFlags>) => void` | |
| `setMultiple` | `(fld: number, on: boolean) => void` | |
| `setOptions` | `(o: PivotOptions) => void` | |
| `setRowLayout` | `(o: { blankRow?: boolean; fillDown?: boolean }) => void` | |
| `setShowAll` | `(fld: number, on: boolean) => void` | |
| `setSpec` | `(spec: PivotSpec) => void` | |
| `setSubtotalsOf` | `(fld: number, s: Partial<FieldSubtotals>) => void` | |
| `sheet` | `() => ExcelWorksheet` | |
| `showAll` | `(fld: number) => boolean` | |
| `sort` | `(fld: number, s: FieldSortSpec) => void` | |
| `spec` | `() => PivotSpec` | |
| `styles` | `() => StyleBook` | |
| `subtotals` | `() => "AtTop" \| "AtBottom" \| "Off"` | |
| `subtotalsOf` | `(fld: number) => FieldSubtotals` | |
| `summary` | `(fld: number) => Aggregate` | |

## `PivotFilters`

`Excel.PivotFilters`; a date filter is refused.

Import from `@reductoai/xlsx/officejs`.

| Name | Type | Description |
| - | - | - |
| `dateFilter?` | `unknown` | |
| `labelFilter?` | `PivotLabelFilter` | |
| `manualFilter?` | `PivotManualFilter` | |
| `valueFilter?` | `PivotValueFilter` | |

## `PivotFilterType`

Not exported by name. You get it from the API.

```ts theme={null}
type PivotFilterType = "Unknown" | "Value" | "Manual" | "Label" | "Date"
```

## `PivotItemsHost`

What a field's items read and write their filter through.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `filter` | `() => PivotFieldFilter` | |
| `setExpanded` | `(items: Scalar[] \| null, on: boolean) => void` | |
| `setFilter` | `(visible: Scalar[] \| null) => void` | |

## `PivotLabelFilter`

Import from `@reductoai/xlsx/officejs`.

| Name | Type | Description |
| - | - | - |
| `comparator?` | `string` | |
| `condition` | `LabelFilterCondition` | |
| `exclusive?` | `boolean` | |
| `lowerBound?` | `string` | |
| `substring?` | `string` | |
| `upperBound?` | `string` | |

## `PivotManualFilter`

`Excel.PivotManualFilter`: the items to show, by name or handle.

Import from `@reductoai/xlsx/officejs`.

| Name | Type | Description |
| - | - | - |
| `selectedItems` | `(string \| { name: string })[]` | |

## `PivotValueFilter`

Import from `@reductoai/xlsx/officejs`.

| Name | Type | Description |
| - | - | - |
| `comparator?` | `number` | |
| `condition` | `ValueFilterCondition` | |
| `exclusive?` | `boolean` | |
| `lowerBound?` | `number` | |
| `selectionType?` | `"Items" \| "Percent" \| "Sum"` | |
| `threshold?` | `number` | |
| `upperBound?` | `number` | |
| `value` | `string` | The data hierarchy the filter measures. |

## `ShowAsCalculation`

Not exported by name. You get it from the API.

```ts theme={null}
type ShowAsCalculation = "Unknown" | "None" | "PercentOfGrandTotal" | "PercentOfRowTotal" | "PercentOfColumnTotal" | "PercentOfParentRowTotal" | "PercentOfParentColumnTotal" | "PercentOfParentTotal" | "PercentOf" | "RunningTotal" | "PercentRunningTotal" | "DifferenceFrom" | "PercentDifferenceFrom" | "RankAscending" | "RankDecending" | "Index"
```

## `ShowAsRule`

`baseItem` takes Excel's "(previous)" and "(next)" as names too (extension; VBA's
`xlPrevious`/`xlNext`): the item before or after each cell's own.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `baseField?` | `PivotField \| { name: string }` | |
| `baseItem?` | `PivotItem \| { name: string }` | |
| `calculation` | `ShowAsCalculation` | |

## `SlicerCrossFilter`

Slicer Settings' items with no data, VBA's `CrossFilterType`.

Not exported by name. You get it from the API.

```ts theme={null}
type SlicerCrossFilter = "ShowItemsWithDataAtTop" | "ShowItemsWithNoData" | "None" | "HideItemsWithNoData"
```

## `SlicerSortType`

Import from `@reductoai/xlsx/officejs`.

```ts theme={null}
type SlicerSortType = "DataSourceOrder" | "Ascending" | "Descending"
```
