We’ve heard from many of you that you’d like an efficient way of displaying your app’s data in a chart or table. For instance, maybe you’d like to be able to show a graph of new user signups by month, or show a table of total sales by region and account.
We now have a tool for supporting this kind of operation. It’s called “:group by”, and you apply it on top of a search or other list of data items in order to group and summarize the list.
The basic concept is that you define one or more groupings, which specify how we group the data (by creation date? by category? by owner?) and then one or more aggregations, which specify what you want to know about it (how many items there are, or the sum or average of a number field, etc.)
The output of the group by operation is a new, shorter list, that contains items that represent the resulting groups. Each group has the fields you grouped on, and the aggregations we calculated describing the group. You can then use this new list as the data to display in a chart element or a repeating group element.
For more details on exactly how groupings and aggregations work, please see the description of the new feature in the reference: https://bubble.is/reference#Data.Messages.list.group_by