# How to Sum "Columns" in a repeating group using another repeating group?

**URL:** <https://forum.bubble.io/t/how-to-sum-columns-in-a-repeating-group-using-another-repeating-group/91975>\
**Category:** App Organization\
**Created:** [May 15, 2020, 3:42pm UTC](https://forum.bubble.io/t/how-to-sum-columns-in-a-repeating-group-using-another-repeating-group/91975 "2020-05-15T15:42:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![robert](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/robert/32/149181_2.png) [@robert](https://forum.bubble.io/u/robert)\
**Post date:** [May 15, 2020, 3:42pm UTC](https://forum.bubble.io/t/how-to-sum-columns-in-a-repeating-group-using-another-repeating-group/91975/1 "2020-05-15T15:42:41Z")

</div>

I’m trying to use a repeating group to calculate the sum of a list of things (number inputs) in another repeating group by the order of each thing.

It’s easier to explain by video: [https://share.getcloudapp.com/geuW75Oy](https://share.getcloudapp.com/geuW75Oy)

Editor: [https://bubble.io/page?type=page&name=periods&id=malt-test2&tab=tabs-1](https://bubble.io/page?type=page&name=periods&id=malt-test2&tab=tabs-1)

Ideas?

---

<div class="post-metadata">

**Author:** ![w.fly](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/w.fly/32/26894_2.png) [@w.fly](https://forum.bubble.io/u/w.fly)\
**Post date:** [May 15, 2020, 3:54pm UTC](https://forum.bubble.io/t/how-to-sum-columns-in-a-repeating-group-using-another-repeating-group/91975/2 "2020-05-15T15:54:40Z")

</div>

I recently just went through this - Incredibly painful… I hate how limited RGs are. Especially in your case, trying to use 1 RG to access data in another RG… lol accessing data in 1 RG is hard enough!!

Best recommendation is to get @gaurav 's RepeatingGroupTools (bdk) plugin. It allowed me to take data from one repeating group on my page and sum it in each row of another repeating group.

Here’s a screenshot of my app: When you change the “CASH Account” dropdown at the bottom, it updates the sum in the repeating group at the top (CASH Needs Thru). Disregard the fact that CASH Needs doesn’t add up - I have other numbers being added into that.

 ![Screen Shot 2020-05-15 at 10.51.57 AM](https://us1.discourse-cdn.com/bubble/original/3X/1/2/128187736d58cda876d37ab64aac9834f864da14.png)

Is this helpful? Or did I completely misunderstand what you’re trying to do here haha…

---

<div class="post-metadata">

**Author:** ![robert](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/robert/32/149181_2.png) [@robert](https://forum.bubble.io/u/robert)\
**Post date:** [May 15, 2020, 4:03pm UTC](https://forum.bubble.io/t/how-to-sum-columns-in-a-repeating-group-using-another-repeating-group/91975/3 "2020-05-15T16:03:42Z")

</div>

Thanks @w.fly. I’ve used RGTools plugin before. May have to do that again.

Appreciate your help. It seems as if we are working on similar things (i.e. using Bubble for financial applications).

---

<div class="post-metadata">

**Author:** ![robert](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/robert/32/149181_2.png) [@robert](https://forum.bubble.io/u/robert)\
**Post date:** [May 16, 2020, 8:00pm UTC](https://forum.bubble.io/t/how-to-sum-columns-in-a-repeating-group-using-another-repeating-group/91975/4 "2020-05-16T20:00:41Z")

</div>

OK, I’ve figured it out without needing a plugin. The key is to create a sequential number field in the datatype. By having a sequence (i.e. 1 thru 12 for 12 monthly periods) you can use the Constraint in the Do a Search For… function to match the thing’s sequence number (in my case the Account Period’s period#) to the Current cell’s index.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/7/e/7e338949cd3f4ceef19042f904a8fdededc10a52.png)

And if you need it to have flexibility to go above the 1 thru X predetermined range (mine is 1 thru 12), you can modify the Current cell’s index number by simple addition of an offset number.

So, in my case, I use the extract function to determine the number of months different from the starting date. So if I want to show months 13 - 24, I change the dropdown year to 2021, from 2020, so the visible range is now Jan - Dec 2021 (i.e. months 13 - 24). The extracted offset number is 12, so the Current cell’s index number + offset# (12), yields a numeric range of 13-24, exactly matching the periods I want to match.

---

<div class="post-metadata">

**Author:** ![addison1](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/addison1/32/76333_2.png) [@addison1](https://forum.bubble.io/u/addison1)\
**Post date:** [February 18, 2021, 7:29pm UTC](https://forum.bubble.io/t/how-to-sum-columns-in-a-repeating-group-using-another-repeating-group/91975/5 "2021-02-18T19:29:19Z")

</div>

You can also create two different types of data sources, and use the “do a search for” and then “calculate sum product a\*b” function which works awesome. You can do some pretty advanced calculations if you know how to structure your database with it, thats the key.
