Solved

Calculate sum of numbers in a collection

  • 2 August 2023
  • 5 replies
  • 151 views

Badge +2

I have a collection that holds multiple numbers derived from list items. There are more than two numbers in this collection at any one time. I need to add those numbers together and was told I can do so with a math operation, but I haven’t been able to figure it out. 

This is in SharePoint 2016.

icon

Best answer by bamaeric 3 August 2023, 19:06

View original

5 replies

Userlevel 5
Badge +13

Check out these two recent posts:

Math Operation Calculating Previous Values | Community (nintex.com)

Unable to Access Calculated Variables | Community (nintex.com)

Badge +2

So I reviewed those posts and I’m still stuck. Here is what I am working with:

This is the section of the workflow I am working on. The goal is to get each employees time entries for the given week, add the submitted time together, and store that total in a new list item on a different list. It successfully queries the list for each entry based on employee, but I am completely lost on how to get the sum of entered time.

To simplify: For each employee, get their time entries, add together all of the weekly regular hours entered, and update a corresponding list item in a different list with the full total. 

For each:

 

This is the list query to get their entries:

 

 

This is the math operation where I am stuck. The numbers I need to add together are all in a collection variable. Do I need to turn the collection into something else before this?
 


And this is the update item, which does work correctly when I tested the math operation using basic values. 

 

 

 

Userlevel 5
Badge +13

Below are images for an online of how you would total the weekly hours for each employee. Please let me know if you have any questions.

 

 

Badge +2

It worked! Thank you so much!

Userlevel 5
Badge +13

You’re welcome. Glad I could help!

Reply