Help Calculating Total Row in Table

Hello,
I have a table as show below: the last row should calculate the total. Say the total of Milk for example.

The amount of Milk in each item’s own row is calculated by searching items:
Search recipe where product is this batch's product and ingredient is do a search for ingredients where name is "Milk" * This batch's quantity.

Now I need to do that in the total row, but that’s really confusing now, because I don’t know how to multiply each batch’s quantity with its respective recipe’s ingredients—and not multiply all recipes with all quantities.

Any help?

Note: all products in this example are the same but in theory there are different products with each different recipes.

Judging from this post of 2018 (quite old!) that’s not possible: How to add numbers in Repeating Group? - #2 by romanmg
Are there any upgrades in expressions since then that allow multiplying values for each item in a list?

You could use the calculate formula option and select sumproduct

That will ask for 2 lists of numbers X1, X2, X3, ... and Y1, Y2, Y3, ... and will provide the result as (X1*Y1) + (X2*Y2) + ...


Cheers,
Ranjit from Atomic Fusion

Explore and reuse the community’s Bubble assets & Accelerate your Bubble development with Atomic Fusion

1 Like

Lovely. Let me try this.

1 Like

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