Forum Academy Marketplace Showcase Pricing Features

Summing a sum. Do I really have to use javascript?

Hola and happy Friday!

I’ve got a RG of employers and for each employer I’m summing up number of employees and then multiplying by the price per employee. Works great. I can easily see : Cost per employer = number employees * price per employee

Now, I want to sum up all of these to get the total cost for All Employers I was thinking I could just sum the “inputs” but doesn’t seem to fly.

Thoughts? Much Appreciated.

I ended up calculating then storing the Employer sum in the database first, then just summing each sum from the database

Funny, I was just thinking that. Thanks I’ll give it a try.

For my case I wanted to do all calculations in the backend in case the user changes a quantity then closes out before it could update, so in backend workflows I set up a database trigger so if anything is changed it triggered a recalculation of the sum. Then triggered a sum of the sums