# PivotValueField Class

> PivotValueField class in the TX Sheet Control .NET API: Aggregation and post-aggregation display settings for one measure.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > PivotValueField Class
- **1131 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/llms-full.txt

---

Aggregation and post-aggregation display settings for one measure.

Pivot handles are obtained through the owning workbook or worksheet collection.

### Members

| Member | Description |
|---|---|
| [Field](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/field-property/llms-full.txt) | Source or calculated field name. |
| [Caption](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/caption-property/llms-full.txt) | Unique value caption; defaults to aggregation of field. |
| [Aggregation](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/aggregation-property/llms-full.txt) | sum, count, countNumbers, average, min, max, product, stddev, stddevp, variance, variancep, or distinctCount. |
| [NumberFormatCode](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/numberformatcode-property/llms-full.txt) | Excel-style number format for output cells. |
| [ShowAs](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/showas-property/llms-full.txt) | normal, percentages, difference, percentDifference, runningTotal, rankAscending, rankDescending, or index. |
| [BaseField](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/basefield-property/llms-full.txt) | Axis field used by difference, running total, or ranking. |
| [BaseItem](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/baseitem-property/llms-full.txt) | Typed comparison member; omitted uses the previous member. |

### Example

```csharp
using TXTextControl.TXSheetControl.Server;

await using var control = new ServerSheetControl();
var workbook = control.Workbook;
var source = await workbook.Sheets.AtAsync(0);
await source.Range("A1:D5").SetValuesAsync([
    ["Region", "Category", "Revenue", "Cost"],
    ["Europe", "Software", 1250, 500], ["Europe", "Services", 700, 350],
    ["Americas", "Software", 1800, 900], ["Americas", "Services", 950, 400]
]);
var report = await workbook.Sheets.AddAsync("Sales Pivot");
var pivot = await report.PivotTables.AddAsync(new PivotTableOptions {
    Name = "RegionalSales", Source = new() { SheetId = source.Id, Range = "A1:D5" },
    Destination = new() { SheetId = report.Id, Cell = "B3" },
    Rows = [new() { Field = "Region" }], Columns = [new() { Field = "Category" }],
    Values = [new() { Field = "Revenue", Caption = "Sales", NumberFormatCode = "$#,##0.00" }]
});
```

See [Pivot Tables](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/pivot-tables/llms-full.txt) for field settings, output and lifetime rules.

### Constructor

```csharp
public PivotValueField()
```

Creates an instance with the property defaults shown in this reference. Settings are validated when applied to the owning document; result objects obtained from document operations are detached snapshots.

---

## In This Section

- [PivotValueField.Aggregation Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/aggregation-property/llms-full.txt): PivotValueField.Aggregation property in the TX Sheet Control .NET API, with its syntax, its type string? and a C# example.
- [PivotValueField.BaseField Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/basefield-property/llms-full.txt): PivotValueField.BaseField property in the TX Sheet Control .NET API: Axis field used by difference, running total, or ranking.
- [PivotValueField.BaseItem Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/baseitem-property/llms-full.txt): PivotValueField.BaseItem property in the TX Sheet Control .NET API: Typed comparison member; omitted uses the previous member.
- [PivotValueField.Caption Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/caption-property/llms-full.txt): PivotValueField.Caption property in the TX Sheet Control .NET API: Unique value caption; defaults to aggregation of field.
- [PivotValueField.Field Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/field-property/llms-full.txt): PivotValueField.Field property in the TX Sheet Control .NET API: Source or calculated field name. Shown with its type string and a C# example.
- [PivotValueField.NumberFormatCode Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/numberformatcode-property/llms-full.txt): PivotValueField.NumberFormatCode property in the TX Sheet Control .NET API, with its syntax, its type string? and a C# example.
- [PivotValueField.ShowAs Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/showas-property/llms-full.txt): PivotValueField.ShowAs property in the .NET API: normal, percentages, difference, percentDifference, runningTotal, rankAscending, rankDescending, or index.

---

## Nearby

- **Previous:** [PivotTableOptions.FieldListSort Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivottableoptions/fieldlistsort-property/llms-full.txt)
- **Next:** [PivotValueField.Field Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotvaluefield/field-property/llms-full.txt)
