Can I do Group By for results of api.find()?
Question
When searching the Product Extensions (or product master), it would be sometimes useful to be able to calculate SUM or AVG of certain columns. I.e., we need to make a Group By for api.find()
. Is that possible?
Answer
One of the variants of api.find()
has the “fields” parameter where you can define which columns you want to summarize. You can pass a map into this parameter in the format ['attribute' : 'aggregation type'], where aggregation type can be one of SUM, AVG, MIN or MAX. See the api.find() API documentation for more info.
, multiple selections available,
Related content
Aggregation and Grouping Items in Result Matrices
Aggregation and Grouping Items in Result Matrices
More like this
Aggregations
Aggregations
More like this
Read / Lookup / Search / Find Functions
Read / Lookup / Search / Find Functions
Read with this
General Queries (Quick Reference)
General Queries (Quick Reference)
More like this
Definition (QueryAPI)
Definition (QueryAPI)
More like this
Price Lists
Price Lists
Read with this
Found an issue in documentation? Write to us.