• Getting Started
  • Components
    • Barcodes
    • Buttons
    • Chartsupdated
    • Conversational UIupdated
    • Data Query
    • Date Inputsupdated
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Filter
    • Gantt
    • Gauges
    • Gridupdated
    • Icons
    • Indicators
    • Inputsupdated
    • Labels
    • Layout
    • ListBox
    • ListView
    • Map
    • Menus
    • Navigation
    • Notification
    • Pager
    • PDF Export
    • PDFViewer
    • PivotGridupdated
    • Popup
    • ProgressBars
    • Ripple
    • Schedulerupdated
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • ToolBar
    • Tooltips
    • TreeList
    • TreeView
    • Typography
    • Uploads
    • Utilities
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Sample Applications
  • FAQ
  • Troubleshooting
  • Updates
  • Changelogs
New to Kendo UI for Angular? Start a free 30-day trial

aggregateBy<T>

Applies the specified AggregateDescriptors to the data. Returns an AggregateResult instance.

const data = [
   { unitPrice: 23, unitsInStock: 21 },
   { unitPrice: 10, unitsInStock: 12 },
   { unitPrice: 20, unitsInStock: 33 }
];

const result = aggregateBy(data, [
  { aggregate: "sum", field: "unitPrice" },
  { aggregate: "sum", field: "unitsInStock" }
]);

//output:
// {
//     "unitPrice": { "sum": 53 },
//     "unitsInStock": { "sum": 66 }
// }

Parameters

data T[]

The data on which the calculation will be executed.

descriptors AggregateDescriptor[]

The aggregate operations that will be executed.

transformers (reduce: Combinator) => Transformer

For internal use.

Returns

AggregateResult - The aggregated result. For more information, refer to the aggregateresult configuration.

In this article

Not finding the help you need?