> ## 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: editor: PivotTables and slicers

## `AxisFieldPatch`

`subtotals` is the automatic subtotal; `functions` the custom ones, which turn it off.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `blankLine?` | `boolean` | |
| `compact?` | `boolean` | |
| `functions?` | `SubtotalFunctionKey[]` | |
| `name?` | `string` | |
| `repeatLabels?` | `boolean` | |
| `showAllItems?` | `boolean` | |
| `subtotals?` | `boolean` | |
| `subtotalTop?` | `boolean` | |
| `tabular?` | `boolean` | |

## `AxisFieldSettings`

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type AxisFieldSettings = Required<AxisFieldPatch> & { field: string; pivot: string; row: boolean }
```

## `Pivot`

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

| Name | Type | Description |
| - | - | - |
| `drills?` | `PivotDrill[]` | Expand and collapse buttons on item labels. |
| `filterArrowCells` | `PivotFilterArrow[]` | |
| `look?` | `PivotLook` | What the pivot style paints on, when the pivot names a style. |
| `name` | `string` | |
| `range` | `Merge` | |
| `shifts?` | `{ c: number; px: number; r: number }[]` | Pixels each label's text moves right for the buttons, past its own indent. |

## `PivotCalcFieldSettings`

What the Insert Calculated Field window lists: every field, and the formulas of the calculated ones.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `calculated` | `{ formula: string; name: string }[]` | |
| `fields` | `string[]` | |
| `next` | `string` | Excel's first free "FieldN". |
| `pivot` | `string` | |

## `PivotCalcItemCommand`

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type PivotCalcItemCommand = { field: string; formula: string | null; name: string; pivot: string; type: "pivotCalcItem" } | { order: { field: string; name: string }[]; pivot: string; type: "pivotSolveOrder" } | { pivot: string; type: "pivotListFormulas" }
```

## `PivotCalcItemSettings`

What the Insert Calculated Item window shows for the field under the active cell.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `calculated` | `{ formula: string; name: string }[]` | This field's calculated items, formulas as the window shows them. |
| `field` | `string` | |
| `fields` | `{ items: string[]; name: string }[]` | Every field with items, and its items (calculated ones too), for the Fields and Items lists. |
| `next` | `string` | Excel's first free "FormulaN". |
| `pivot` | `string` | |

## `PivotDrill`

A +/- button on a pivot item label, 1-based; `item` is the shared item index, `x` the box's offset from the cell's left edge.

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

| Name | Type | Description |
| - | - | - |
| `c` | `number` | |
| `expanded` | `boolean` | |
| `field` | `number` | |
| `item` | `number` | |
| `r` | `number` | |
| `x` | `number` | |

## `PivotFilterArrow`

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

| Name | Type | Description |
| - | - | - |
| `axis` | `PivotFilterAxis` | |
| `c` | `number` | |
| `field` | `string` | |
| `filtered?` | `boolean` | |
| `r` | `number` | |
| `sort?` | `"ascending" \| "descending"` | |

## `PivotFilterAxis`

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

```ts theme={null}
type PivotFilterAxis = "row" | "column" | "page"
```

## `PivotGroupingSettings`

The Grouping window: `label` is the field clicked, `field` the source field it groups.

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type PivotGroupingSettings = PivotGrouping & { date1904: boolean; endText: string; label: string; pivot: string; startText: string }
```

## `PivotLine`

One body line; `key` holds an item per field from the outermost, subtotals leave out Values.

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

| Name | Type | Description |
| - | - | - |
| `key` | `number[]` | |
| `t` | `"item" \| "subtotal" \| "grand" \| "blank"` | |

## `PivotLook`

A pivot's style, its options and the shape of its body, offsets 0-based inside `range`.

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

| Name | Type | Description |
| - | - | - |
| `colLines` | `PivotLine[]` | |
| `firstDataCol` | `number` | |
| `firstDataRow` | `number` | |
| `firstHeaderRow` | `number` | |
| `labelCols` | `number[]` | Per row field (the Values field included): the column of its labels, and whether it is tabular. |
| `pages` | `number` | Page fields above the table, one row each. |
| `rowLines` | `PivotLine[]` | `<rowItems>` and `<colItems>`, one per body row and column. |
| `showColHeaders` | `boolean` | |
| `showColStripes` | `boolean` | |
| `showLastColumn` | `boolean` | |
| `showRowHeaders` | `boolean` | |
| `showRowStripes` | `boolean` | |
| `style` | `string` | |
| `tabular` | `boolean[]` | |

## `PivotMoveSettings`

What the Move PivotTable window starts with: the table's first cell, "Sheet1!$F$3".

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `location` | `string` | |
| `pivot` | `string` | |

## `PivotOptionsPatch`

The boxes of Windows Excel's PivotTable Options, named as the facade names them.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `allowMultipleFiltersPerField?` | `boolean` | |
| `altTextDescription?` | `string` | |
| `altTextTitle?` | `string` | |
| `autoFormat?` | `boolean` | |
| `displayErrorString?` | `boolean` | |
| `emptyCellText?` | `string` | |
| `enableDataValueEditing?` | `boolean` | |
| `enableFieldList?` | `boolean` | |
| `errorString?` | `string` | |
| `fillEmptyCells?` | `boolean` | |
| `missingItemsLimit?` | `number` | Number of items to retain per field: -1 Automatic, 0 None, 1048576 Max. |
| `name?` | `string` | |
| `preserveFormatting?` | `boolean` | |
| `refreshOnOpen?` | `boolean` | |
| `showColumnGrandTotals?` | `boolean` | |
| `showDrillIndicators?` | `boolean` | |
| `showFieldHeaders?` | `boolean` | |
| `showRowGrandTotals?` | `boolean` | |
| `useCustomSortLists?` | `boolean` | |

## `PivotOptionsSettings`

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type PivotOptionsSettings = Required<PivotOptionsPatch> & { pivot: string }
```

## `PivotSolveOrderSettings`

The Solve Order window's list, first solved first.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `items` | `CalcItemInfo[]` | |
| `pivot` | `string` | |

## `PivotSourceSettings`

What the Change PivotTable Data Source window starts with.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `pivot` | `string` | |
| `source` | `string` | |

## `SlicerConnection`

A row of Report Connections: a pivot table on the slicer's pivot cache.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `connected` | `boolean` | |
| `pivotTable` | `string` | |
| `sheet` | `string` | |

## `SlicerPatch`

What Slicer Settings and the Slicer tab change; sizes in points.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `buttonHeight?` | `number` | |
| `buttonWidth?` | `number` | |
| `caption?` | `string` | |
| `columnCount?` | `number` | |
| `crossFilter?` | `"ShowItemsWithDataAtTop" \| "ShowItemsWithNoData" \| "None" \| "HideItemsWithNoData"` | |
| `height?` | `number` | |
| `name?` | `string` | |
| `showHeader?` | `boolean` | |
| `showItemsDeleted?` | `boolean` | Items the source lost since the pivot cache last held them; a pivot slicer's only. |
| `sortBy?` | `"Ascending" \| "Descending"` | |
| `sortUsingCustomLists?` | `boolean` | |
| `style?` | `string` | |
| `width?` | `number` | |

## `SlicerSettings`

A slicer as Slicer Settings shows it.

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type SlicerSettings = Required<Omit<SlicerPatch, "name">> & { formulaName: string; name: string; pivot: boolean; sourceName: string }
```

## `SubtotalFn`

Subtotal's "Use function" list, in Excel's order.

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type SubtotalFn = "sum" | "count" | "average" | "max" | "min" | "product" | "countNums" | "stdDev" | "stdDevP" | "var" | "varP"
```

## `SubtotalFunctionKey`

A custom subtotal function, by its `Excel.Subtotals` key.

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type SubtotalFunctionKey = "sum" | "count" | "average" | "max" | "min" | "product" | "countNumbers" | "standardDeviation" | "standardDeviationP" | "variance" | "varianceP"
```

## `SubtotalGuess`

Subtotal's dialog: the list it works on and its header labels by sheet column.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `columns` | `{ col: number; label: string }[]` | |
| `list` | `CellBlock` | |
| `subtotals` | `boolean` | The list holds SUBTOTAL rows already. |

## `ValueFieldPatch`

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `name?` | `string` | |
| `numberFormat?` | `string` | |
| `showAs?` | `ValueShowAs` | |
| `summarizeBy?` | `string` | |

## `ValueFieldSettings`

A value field as Value Field Settings shows it, with the fields and items Show Values As offers.

Import from `@reductoai/xlsx/editor`.

```ts theme={null}
type ValueFieldSettings = Required<ValueFieldPatch> & { baseFields: { items: string[]; name: string }[]; field: string; pivot: string; sourceName: string }
```

## `ValueShowAs`

A value field's Show Values As, by field and item name; "(previous)" and "(next)" are items too.

Import from `@reductoai/xlsx/editor`.

| Name | Type | Description |
| - | - | - |
| `baseField?` | `string` | |
| `baseItem?` | `string` | |
| `calculation` | `ShowAsCalculation` | |

## `ViewSlicer`

A slicer as it paints: the frame drawing of the same name carries its place and size.

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

| Name | Type | Description |
| - | - | - |
| `caption` | `string` | |
| `columns` | `number` | |
| `filtered` | `boolean` | |
| `items` | `{ hasData: boolean; name: string; selected: boolean }[]` | In the order the slicer lists them. |
| `name` | `string` | |
| `noCrossFilter` | `boolean` | No cross filtering: every item paints as having data. |
| `rowHeightPt` | `number` | Button height in points. |
| `showCaption` | `boolean` | |
| `style` | `string` | |
