Summary Type

IMPORTANT

This feature is applicable only for Relational datasource only at Client Mode.

Allow us to specify the required layout that PivotGrid should use in its summary cells. “Sum” is the default summary type. Following summary types that are supported:

  • Sum
  • Average
  • Count
  • Min
  • Max
  • js
  • <script>
        var pivot_dataset = []; // Specify Data source
        var dataSource = {
                data: pivot_dataset,
                ///...
                values: [
                    {
                        fieldName: "Amount",
                        fieldCaption: "Amount",
                        summaryType: ej.PivotAnalysis.SummaryType.Average
                    },
                    {
                        fieldName: "Quantity",
                        fieldCaption: "Quantity",
                        summaryType: ej.PivotAnalysis.SummaryType.Sum
                    }
                ]
            };
     
        angular.module("PivotGridApp",["ejangular"]).controller('PivotGridCtrl', function ($scope) 
        {
            $scope.datasource = dataSource;
        });
    </script>
    Caption to image