# How to display summary data by category

**URL:** <https://forum.bubble.io/t/how-to-display-summary-data-by-category/133628>\
**Category:** Database\
**Created:** [January 31, 2021, 12:13am UTC](https://forum.bubble.io/t/how-to-display-summary-data-by-category/133628 "2021-01-31T00:13:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nik\_k](https://avatars.discourse-cdn.com/v4/letter/n/b782af/32.png) [@nik\_k](https://forum.bubble.io/u/nik_k)\
**Post date:** [January 31, 2021, 12:13am UTC](https://forum.bubble.io/t/how-to-display-summary-data-by-category/133628/1 "2021-01-31T00:13:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [January 31, 2021, 1:18am UTC](https://forum.bubble.io/t/how-to-display-summary-data-by-category/133628/2 "2021-01-31T01:18:25Z")

</div>

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…

 ![group](https://us1.discourse-cdn.com/bubble/original/3X/8/8/88454fe49ee6019cc51a803e3aa27474824d03be.png)

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

Best…  
Mike

---

<div class="post-metadata">

**Author:** ![nik\_k](https://avatars.discourse-cdn.com/v4/letter/n/b782af/32.png) [@nik\_k](https://forum.bubble.io/u/nik_k)\
**Post date:** [January 31, 2021, 1:37am UTC](https://forum.bubble.io/t/how-to-display-summary-data-by-category/133628/3 "2021-01-31T01:37:30Z")

</div>

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.
