I have a repeating group of items to purchase.
Each item has, among other fields: price, tax%, quantity.
Because I am using auto binding I don’t want to create field for each item that calculate Tot Netto and Tot Brutto for each Item (I would not know how to auto-bind them!).
Therefore I want to have a Text fiedl in the bottom that Calculates the totals of all the item in my list:
TOT NETTO: for each item. multiply price/unit and quantity and summ all of them
TOT BRUTTO: … add taxes.
Hey Jarrad, I saw your example in another post.
This is a kind of not general solution, but I have to put a limit to the number of items in the list (e.g. 20) and there sum 20 times the formula.
I was hoping that meanwhile bubble had developed a more general approach for very long lists…
but for now it will do…
No worries, maybe this might be worth looking at if you haven’t already,
Keep in mind a lot of things in bubble will still calculate even when hidden so maybe this table hidden could be a way out. Also have a look at the math.js and the toolbox plugins as math functions or JavaScript variables might help to knock down the code. Cheers
I found the function Calculate Formula/Sumproduct.
It works very well to calculate the Total Netto: Price * Quantity, but it is limited to ONLY two items!
But for Tot Brutto I need to multiply also the Taxes for each item. @emmanuel, can be extended at least to 3 items!!! That would do the trick in a scalable and elegant way…
It seems there is something in the way I call the field("") or value()… is there an example, a tutorial that can help me our? What I am suppose to use to call the data? The name used in the database editor? do I have to use underscore instead of spaces?
There is an issue in the name of the field in the database. Is that a bug?
I messed in the past with name of the fields, and delete some, but the system keep having them hidden.
If I copy and Paste a Data type, they all reapper in the copy and I could see there were two identical called “Price”.
I just renamed the one I was using as PriceNetto, and now everything works piece of cake.