Sumproduct from 3 lists of numbers

Hi, how can i sumproduct from 3 lists of numbers?
I know how to use “calculate formula/ sumproduct” to sumproduct 2 lists of numbers but I need to sumproduct 3 lists of numbers.

List 1: [1,10,20]
List 2: [5,2,1]
List 3: [2,2,3]

Expected result = 1x5x2+10x2x2+20x1x3=110

thanks!

Hey @42.decaen :wave:

I think Bubble can’t handle this so you need to outsource it to Math.js. I used this plugin: Math.js Local Lite Plugin | Bubble

See the screenshot below:

You need to create an Mathjs element in the page with the correct formula to produce sum product of these 3. In Math.js, the operator that does this multiplication only accepts two elements though. So, you will do the first two, and then you will multiply the result with the last one, and then you will sum all.

The mathjs element with the corresponding formula:

sum(dotMultiply(dotMultiply([1, 10, 20],[5, 2, 1]),[2, 2, 3]))

And here is how you print the result to a text:
image

If you want to check the details, here is the editor: Bubble Demos by Flusk | Bubble Editor

I hope this helps.

bdk_512x512 @Huseyin from Flusk | Discover the #1 Security and Monitoring Tool for Bubble

Many thanks @flusk for this detailed answer, works very well!

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