New to Kendo UI for jQuery? Start a free 30-day trial

A set of key/value pairs which specifies the available measures. The key specifies the name of measure.

The key has to match the measure name that is used in the measures definition of the PivotDataSourceV2.

<script>
  var dataSource = new kendo.data.PivotDataSourceV2({
    columns: ["ProductName" ],
    rows: ["Category"],
    measures: ["Sum"],
    data: [{ ProductName: "Chai", UnitPrice: 42, Cateogry: "Beverages" } ],
    schema: {
      cube: {
        dimensions: {
          ProductName: { caption: "All Products" },
          Category: { caption: "All Cateogries" }
        },
        measures: {
          "Sum": {
              field: "UnitPrice",
              format: "{0:c}",
              aggregate: "sum"
          }
        }
      }
    }
  });

  dataSource.fetch(function() {
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(dataSource.data(), dataSource.axes());
  });
</script>

The function that is used to aggregate the measure value.

The built-in aggregates are:

  • average
  • count
  • max
  • min
  • sum
<script>
  var dataSource = new kendo.data.PivotDataSourceV2({
    columns: ["ProductName" ],
    rows: ["Category"],
    measures: ["Sum"],
    data: [{ ProductName: "Chai", UnitPrice: 42, Cateogry: "Beverages" } ],
    schema: {
      cube: {
        dimensions: {
          ProductName: { caption: "All Products" },
          Category: { caption: "All Cateogries" }
        },
        measures: {
          "Average": {
            field: "UnitPrice",
            aggregate: "average"
        }
      }
    }
  }
});

  dataSource.fetch(function() {
/* The result can be observed in the DevTools(F12) console of the browser. */
    console.log(dataSource.data(), dataSource.axes());
  });
</script>

The field name whose value is used for calculations.

The format which will be applied to the calculated measure value.