# PivotGrouping Class

> PivotGrouping class in the TX Sheet Control .NET API: Grouping settings applied before aggregation. Shown with a C# example.

- **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 > PivotGrouping Class
- **1013 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotgrouping/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotgrouping/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotgrouping/llms-full.txt

---

Grouping settings applied before aggregation.

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

### Members

| Member | Description |
|---|---|
| [Type](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotgrouping/type-property/llms-full.txt) | years, quarters, months, days, numbers, or manual. |
| [Interval](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotgrouping/interval-property/llms-full.txt) | Positive numeric grouping interval. |
| [Start](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotgrouping/start-property/llms-full.txt) | Numeric lower origin; defaults to zero. |
| [End](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotgrouping/end-property/llms-full.txt) | Optional upper numeric boundary. |
| [Groups](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotgrouping/groups-property/llms-full.txt) | Explicit names and typed member sets for manual grouping. |

### 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 PivotGrouping()
```

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

- [PivotGrouping.End Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotgrouping/end-property/llms-full.txt): PivotGrouping.End property in the TX Sheet Control .NET API: Optional upper numeric boundary. Shown with its type double? and a C# example.
- [PivotGrouping.Groups Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotgrouping/groups-property/llms-full.txt): PivotGrouping.Groups property in the TX Sheet Control .NET API: Explicit names and typed member sets for manual grouping.
- [PivotGrouping.Interval Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotgrouping/interval-property/llms-full.txt): PivotGrouping.Interval property in the TX Sheet Control .NET API: Positive numeric grouping interval. Shown with its type double? and a C# example.
- [PivotGrouping.Start Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotgrouping/start-property/llms-full.txt): PivotGrouping.Start property in the TX Sheet Control .NET API: Numeric lower origin; defaults to zero. Shown with its type double? and a C# example.
- [PivotGrouping.Type Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotgrouping/type-property/llms-full.txt): PivotGrouping.Type property in the TX Sheet Control .NET API: years, quarters, months, days, numbers, or manual. Shown with its type string and a C# example.

---

## Nearby

- **Previous:** [PivotFilter.Count Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotfilter/count-property/llms-full.txt)
- **Next:** [PivotGrouping.Type Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotgrouping/type-property/llms-full.txt)
