# Running Totals

**URL:** <https://community.glideapps.com/t/running-totals/41596>\
**Category:** Ask for Help\
**Created:** [May 3, 2022, 11:04pm UTC](https://community.glideapps.com/t/running-totals/41596 "2022-05-03T23:04:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [May 3, 2022, 11:51pm UTC](https://community.glideapps.com/t/running-totals/41596/2 "2022-05-03T23:51:10Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/e/9e1aa112c3db5c7d67f15501396ae3d8d6898232.png)

Here are the steps to do it exclusively within Glide.

- Add a rowID column.

- Add an IDs array: lookup all rowIDs within this table.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/1/5/15d8de74f4325831bb4accc85b1c61fad3db6fce.png)

- Add an index column, use the plugin Array \> Find Element Index.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/7/6/76ce5b0cea5690be3286b363966200e51170aecd.png)

- Add a template column to lock in the format of the number.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/6/9683eb8e347a708bdccecfd89cfa18ab7bd4239e.png)

- Add a joined list column to join all the “template” numbers.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/d/fd74ecb7ac3f0580169e7f94ad4e1891a008d02e.png)

- Add a JavaScript column to calculate the running total using the list of numbers and the index of each row.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/6/061eb16db6bb4411ee4d57d39e95ceea670a7953.png)

```auto
let numbers = p1.split("||");

let total = 0;

for (i = 0; i <= p2; i++) {
total += parseInt(numbers[i]);
}

return total;

```

---

_[View the full topic](https://community.glideapps.com/t/running-totals/41596)._
