How to display summary data by category

Hi, sorry this feels like it must be so common a need that it’s been answered before - but I can’t find it.

If I have a database with the following entries:

Household Bills 250
Household Bills 100
Electricity Bills 50
Household Bills 200
Gas Bills 25
Electricity Bills 100
Electricity Bills 50

How do I use a repeating group to display the unique categories alongside their sum (i.e. as below)?

Household Bills 550
Electricity Bills 200
Gas Bills 25

I’m letting users define their own categories, so the solution has to be dynamic (i.e. when more categories are added the summary table automatically shows the new category and its total).

Thanks for any help with this, but having searched hard, I’m sure any solution will help many more people than just me!!

cheers, Nik

Hi there, @nik_k … you’re going to need to use the :group by option on the repeating group’s data source. Here is an example of what that looks like in conjunction with a data type for the categories and a data type for the bills that has a field in it that links to the Category data type…

Hope this helps… if you need any additional details or another screenshot or two, just let me know.

Best…
Mike

That’s it!! You are an absolute star @mikeloc !

I was trying to use group by in the RG cells (which wouldn’t work), rather than in the RG Parent

NB: For anyone else reading this, the ‘Grouping’ option in ‘Type of Content’ for the Repeating Group Parent didn’t appear till I’d entered ‘Search for x: grouped by’ expression into the Data source field.

2 Likes