Group Pivot Fields in the Pivot Table

Possible Usage Scenarios

Microsoft Excel allows you to group pivot fields of the pivot table. When there is a large amount of data related to a pivot field, it is often useful to group them into sections. Aspose.Cells for Python via .NET also provides this feature using the PivotTable.set_manual_group_field() method.

How to Group Pivot Fields in the Pivot Table

The following sample code loads the sample Excel file and performs grouping on the first pivot field using the PivotTable.set_manual_group_field() method. It then refreshes and calculates data of the pivot table and saves the workbook as output Excel file. The screenshot shows the effect of the sample code on the sample Excel file. As you can see in the screenshot, the first pivot field is now grouped by months and quarters.

todo:image_alt_text

Sample Code