# Summing up sub total from Repeating Group

**URL:** <https://forum.bubble.io/t/summing-up-sub-total-from-repeating-group/187375>\
**Category:** Need help\
**Created:** [January 20, 2022, 4:20pm UTC](https://forum.bubble.io/t/summing-up-sub-total-from-repeating-group/187375 "2022-01-20T16:20:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jannis.kuhrt](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@jannis.kuhrt](https://forum.bubble.io/u/jannis.kuhrt)\
**Post date:** [January 20, 2022, 4:20pm UTC](https://forum.bubble.io/t/summing-up-sub-total-from-repeating-group/187375/1 "2022-01-20T16:20:20Z")

</div>

Dear all, hope you can help!

I do some calculations within a Repeating Group (red: quantity x price = subtotal (yellow 0).  
Outside of the repeating group I would like to sum up (blue) the subtotals (yellow) towards one total sum ("To be calculated).

![image](https://us1.discourse-cdn.com/bubble/original/3X/f/d/fd393dee31b6f52f5e78e13e300427578f6d0ca7.png)

Any thoughts?

best  
Jannis

---

<div class="post-metadata">

**Author:** ![nico.dicagno](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nico.dicagno/32/207961_2.png) [@nico.dicagno](https://forum.bubble.io/u/nico.dicagno)\
**Post date:** [January 20, 2022, 4:54pm UTC](https://forum.bubble.io/t/summing-up-sub-total-from-repeating-group/187375/2 "2022-01-20T16:54:59Z")

</div>

How is your database organised? I am assuming you have a data thing called Order which has a list of Parts attached to it. Are you saving in the database the quantity of parts which are being bought?

---

<div class="post-metadata">

**Author:** ![jannis.kuhrt](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@jannis.kuhrt](https://forum.bubble.io/u/jannis.kuhrt)\
**Post date:** [January 20, 2022, 5:20pm UTC](https://forum.bubble.io/t/summing-up-sub-total-from-repeating-group/187375/3 "2022-01-20T17:20:17Z")

</div>

@nico.dicagno  
ID / name / quantity / price  
#within one order always the same / apples / 2 / 1€  
#within one order always the same / bananas / 5 / 2€

Already tried it multiple ways with search for but never made it …

---

<div class="post-metadata">

**Author:** ![nico.dicagno](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/nico.dicagno/32/207961_2.png) [@nico.dicagno](https://forum.bubble.io/u/nico.dicagno)\
**Post date:** [January 20, 2022, 7:34pm UTC](https://forum.bubble.io/t/summing-up-sub-total-from-repeating-group/187375/4 "2022-01-20T19:34:59Z")

</div>

Add a field called “subtotal”.  
Make sure that when an Order is created the subtotal price is also calculated and added to the database  
Now on your repeating group, rather than showing an element which is price\*quantity, just show the order’s subtotal.  
Add a workflow that is triggered when the “input quantity is changed” which recalculates the subtotal.  
On the element outside the repeating group, you can put the dynamic text “repeating groups, list of orders, each item’s subtotal, sum”

---

<div class="post-metadata">

**Author:** ![jannis.kuhrt](https://avatars.discourse-cdn.com/v4/letter/j/f17d59/32.png) [@jannis.kuhrt](https://forum.bubble.io/u/jannis.kuhrt)\
**Post date:** [January 21, 2022, 4:17am UTC](https://forum.bubble.io/t/summing-up-sub-total-from-repeating-group/187375/5 "2022-01-21T04:17:18Z")

</div>

awesome! worked out! Thanks @nico.dicagno  
Thought I could do it with outobinding somehow but didnt think about the separate workflow

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [March 31, 2022, 4:20pm UTC](https://forum.bubble.io/t/summing-up-sub-total-from-repeating-group/187375/6 "2022-03-31T16:20:55Z")

</div>

This topic was automatically closed after 70 days. New replies are no longer allowed.
