GroupBy is a function that accepts a list of objects as input and generates a grouped list as output.
It's a powerful tool to implement the use cases of total/subtotal. For example, group the invoice items with the same charge name together and show the subtotal amount of each charge.
Data Transformation
Given a list-type input Items like the following:
[
{ "A": "a1", "B": "b1", "C": "c1", "D": "d1" },
{ "A": "a1", "B": "b1", "C": "c1", "D": "d2" },
{ "A": "a1", "B": "b2", "C": "c1", "D": "d1" },
{ "A": "a2" }
]
The value object has four named properties: A, B, C, D. Items|GroupBy(A,B,C) will output the following: ...