# PivotLayout

Canonical page: https://www.adaptabletools.com/docs/reference/pivotlayout

A pivot layout.

`PivotColumns` is required. Pass an empty array when the layout only shows aggregations. Row groups use `PivotGroupedColumns`. Aggregations use `PivotAggregationColumns`. Leave `TableColumns`, `TableAggregationColumns` and `RowGroupedColumns` unset.

```ts title="TypeScript"
export interface PivotLayout extends LayoutBase 
```

###### Extends

[`LayoutBase`](https://www.adaptabletools.com/docs/reference/layoutbase.md)

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [PivotAggregationColumns](https://www.adaptabletools.com/docs/reference/pivotlayout.md#pivotaggregationcolumns) | [`PivotAggregationColumns`](https://www.adaptabletools.com/docs/reference/pivotaggregationcolumns.md) | Columns showing aggregated values in Group Rows; 1st value in record is Column name, 2nd is either aggfunc (e.g. sum, avg etc.) or &#39;true&#39; (to use default aggfunc) |
| [PivotColumns](https://www.adaptabletools.com/docs/reference/pivotlayout.md#pivotcolumns) | `string[]` | Mandatory list of Columns to pivot (provide empty array if just displaying Aggregations) |
| [PivotColumnTotal](https://www.adaptabletools.com/docs/reference/pivotlayout.md#pivotcolumntotal) | [`PivotTotalPosition`](https://www.adaptabletools.com/docs/reference/pivottotalposition.md) | Display automatically calculated Totals within EACH Pivot Column Group, in the position specified |
| [PivotExpandLevel](https://www.adaptabletools.com/docs/reference/pivotlayout.md#pivotexpandlevel) | `number` | How deep to expand Pivot Columns (0 for none, 1 for 1st level only etc, -1 to expand all) |
| [PivotGrandTotal](https://www.adaptabletools.com/docs/reference/pivotlayout.md#pivotgrandtotal) | [`PivotTotalPosition`](https://www.adaptabletools.com/docs/reference/pivottotalposition.md) | Display automatically calculated Totals of all Pivot Columns, in the position specified |
| [PivotGroupedColumns](https://www.adaptabletools.com/docs/reference/pivotlayout.md#pivotgroupedcolumns) | `string[]` | Columns which are row-grouped when the Layout is applied |
| [PivotResultColumnsOrder](https://www.adaptabletools.com/docs/reference/pivotlayout.md#pivotresultcolumnsorder) | `string[] \| boolean` | Ordered list of Pivot Result Columns; set to `true` to track current display order, or provide custom list |
| [IsReadOnly](https://www.adaptabletools.com/docs/reference/pivotlayout.md#isreadonly) | `boolean` | Sets Entity to ReadOnly (overwriting a Strategy Entitlement of &#39;Full&#39;) |

## Property Details

### PivotAggregationColumns

Columns showing aggregated values in Group Rows; 1st value in record is Column name, 2nd is either aggfunc (e.g. sum, avg etc.) or &#39;true&#39; (to use default aggfunc)

```ts title="TypeScript"
PivotAggregationColumns?: PivotAggregationColumns;
```

###### Property Value

[`PivotAggregationColumns`](https://www.adaptabletools.com/docs/reference/pivotaggregationcolumns.md)

### PivotColumns

Mandatory list of Columns to pivot (provide empty array if just displaying Aggregations)

```ts title="TypeScript"
PivotColumns: string[];
```

###### Property Value

`string[]`

### PivotColumnTotal

Display automatically calculated Totals within EACH Pivot Column Group, in the position specified

```ts title="TypeScript"
PivotColumnTotal?: PivotTotalPosition;
```

###### Property Value

[`PivotTotalPosition`](https://www.adaptabletools.com/docs/reference/pivottotalposition.md)

### PivotExpandLevel

How deep to expand Pivot Columns (0 for none, 1 for 1st level only etc, -1 to expand all)

```ts title="TypeScript"
PivotExpandLevel?: number;
```

###### Property Value

`number`

### PivotGrandTotal

Display automatically calculated Totals of all Pivot Columns, in the position specified

```ts title="TypeScript"
PivotGrandTotal?: PivotTotalPosition;
```

###### Property Value

[`PivotTotalPosition`](https://www.adaptabletools.com/docs/reference/pivottotalposition.md)

### PivotGroupedColumns

Columns which are row-grouped when the Layout is applied

```ts title="TypeScript"
PivotGroupedColumns?: string[];
```

###### Property Value

`string[]`

### PivotResultColumnsOrder

Ordered list of Pivot Result Columns; set to `true` to track current display order, or provide custom list

```ts title="TypeScript"
PivotResultColumnsOrder?: string[] | boolean;
```

###### Property Value

`string[] | boolean`

### IsReadOnly

> *Inherited from [AdaptableObject](https://www.adaptabletools.com/docs/reference/adaptableobject.md)*

Sets Entity to ReadOnly (overwriting a Strategy Entitlement of &#39;Full&#39;)

```ts title="TypeScript"
IsReadOnly?: boolean;
```

###### Property Value

`boolean`
