Consolidation Function

Consolidation function

Aspose.Cells for Python via .NET can be used to apply ConsolidationFunction to data fields (or value fields) of the pivot table. In Microsoft Excel, you can right-click the value field and then select Value Field Settings… option and then select the tab Summarize Values By. From there, you can select any ConsolidationFunction of your choice like Sum, Count, Average, Max, Min, Product, Distinct Count, etc.

Aspose.Cells for Python via .NET provides ConsolidationFunction enumeration to support the following consolidation functions.

  • ConsolidationFunction.AVERAGE
  • ConsolidationFunction.COUNT
  • ConsolidationFunction.COUNT_NUMS
  • ConsolidationFunction.DISTINCT_COUNT
  • ConsolidationFunction.MAX
  • ConsolidationFunction.MIN
  • ConsolidationFunction.PRODUCT
  • ConsolidationFunction.STD_DEV
  • ConsolidationFunction.STD_DEVP
  • ConsolidationFunction.SUM
  • ConsolidationFunction.VAR
  • ConsolidationFunction.VARP

Applying ConsolidationFunction to Data Fields of Pivot Table

The following code applies AVERAGE consolidation function to the first data field (or value field) and DISTINCT_COUNT consolidation function to the second data field (or value field).