# PivotValueField (@salmonui/pivot-table/engine)

> The PivotValueField interface of @salmonui/pivot-table/engine: A value field (one measure of the result).

Canonical: https://salmonui.dev/docs/reference/pivot-table/engine/PivotValueField

```ts
import type { PivotValueField } from '@salmonui/pivot-table/engine';
```

Also exported from `@salmonui/pivot-table`.

Entry index: https://salmonui.dev/docs/reference/pivot-table/engine (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/pivot-table/engine.md).

## Reference

Kind: interface

```ts
interface PivotValueField {
    readonly field: string;
    readonly caption?: string;
    readonly aggregate: PivotAggregate;
    readonly customId?: string;
    readonly showAs?: PivotShowAs;
}
```

A value field (one measure of the result).

Measure ids: every value field has a measure id, unique within
`model.values`, used in `PivotHeaderNode.measure`, `PivotCell.measure`,
header keys (`...|<measure id>`), `valueSort.measure`, value filters and
`formats`. It is `field` when no other value field uses the same field,
`field#aggregate` when one does (`Freight#average`, `Freight#sampleStdev`),
and `field#aggregate#index` (position in `model.values`) when even that
repeats. `measureId(values, index)` computes it. `valueSort.measure`, value
filters and `formats` also accept the plain `field` (first match).

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `field` | `readonly field: string;` |  |  |
| `caption` | `readonly caption?: string;` | optional |  |
| `aggregate` | `readonly aggregate: PivotAggregate;` |  |  |
| `customId` | `readonly customId?: string;` | optional | `aggregate: 'custom'`: key into `PivotEngineOptions.customAggregates`. |
| `showAs` | `readonly showAs?: PivotShowAs;` | optional |  |
