Running Totals

Here are the steps to do it exclusively within Glide.

  • Add a rowID column.

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

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

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

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

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

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

let total = 0;

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

return total;
9 Likes