Forum Academy Marketplace Showcase Pricing Features

Sum values of multiple lists at once

Hi everybody,

i’m currently stuck with a seemingly simple problem:

  1. I have a list of “client” things
  2. Each “client” thing has a list of “project” things
  3. Each “project” thing has a “budget” field with a number in it

I just cannot figure out at the moment how to sum up all the “budget” fields within their respective lists at once.

Is there a realtime calculation method i’m not aware of? Or does the calculation needs to be done at the moment where a “project” thing with the respective “budget” value is being created?

I would like to use the resulting list as an input for datapoints of a line chart. Or a text field with a comma separated list containing the totals for each “project” list of things of each “client” thing.

Any help is very much appreciated, thank you!

@js1

UPDATE

I assume it somehow can be done together with the fabulous toolbox plugin from @mishav and some additional JS…Am i right? Maybe somebody faced a similar issue and can point me in the right direction? In the time being i stick to the hardcoded way, so never mind folks.

2 Likes

When I’ve done this in the past I’ve used a data type called sum that keeps adding every time a new budget(in your case) is added. You can also “do a search for…” the budget data type:sum (make sure the data is being stored as a number so you’re able to call up math functions)

Yes, that is how i do it the “hardcoded” way now. It works ok, but as soon as the budgets are changing or a “project” thing is going to be deleted there is a lot of annoying extra calculation to keep the “pre-calculated” sum up to date. But thats fine. I just thought there must be another way.

Some other posts on this topic:


More alternatives in this post: API calls, and API workflow…

Plus the Bubble function SUMPRODUCT might handle it okay, keeping in mind that it expects two lists of the same length, they don’t have to have fields from the same table.

Edit - Oops I just saw your update, haha. Hopefully this is useful for reference.

1 Like

Thanks @mishav! I will have a look…