Aggregation can be performed on compound data types but grouping can be performed only on simple data types. Consider a collection of vouchers where grouping needs to be done by Stock Item Name, Quantity and Rate etc. As Quantity and Rate are combination of two simple data types, that is, Number + String, they need to be converted into any of the simple data types while grouping over them.
Following code snippet can be referred for this:
[Collection: Test Collection]
Source Collection: Default
Walk : Inventory Entries
By : StockItemName: $StockItemName
By : RateStr : $$String:$Rate
Aggr Compute : Amount : SUM : $Amount