# Need Advice With Sum Of Array

**URL:** <https://community.make.com/t/need-advice-with-sum-of-array/8462>\
**Category:** Questions\
**Created:** [February 22, 2023, 3:19am UTC](https://community.make.com/t/need-advice-with-sum-of-array/8462 "2023-02-22T03:19:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Megaphone](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/megaphone/32/7985_2.png) [@Megaphone](https://community.make.com/u/Megaphone)\
**Post date:** [February 22, 2023, 3:19am UTC](https://community.make.com/t/need-advice-with-sum-of-array/8462/1 "2023-02-22T03:19:32Z")

</div>

I’m not having any success with getting the array sum formula to work for my scenario. I am trying to calculate the sum of the package\_value\_p\_\_month within the arrays of each of the bundles in the attached screenshot.

 ![Screen Shot 2023-02-22 at 2.10.54 pm](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/a/a34d7e5e927dd62209b6a388735f232d6f575730.jpeg)

The correct answer is 10,000 (4,000 from Array 1 + 6,000 from Array 2).

I have tried the numeric aggregator module but the sum is only calculated for the first array in the bundle - it doesn’t factor in the other arrays within in the bundle.

 ![Screen Shot 2023-02-22 at 2.14.51 pm](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/0/0ead8040f22151d88cb5ee231e78d69107e03e5e.png)

As you can see in this screenshot, the only number the sum function picks up on is the the top array’s package\_value\_p\_\_month (4000).

 ![Screen Shot 2023-02-22 at 2.14.45 pm](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/5/54c630af9801facc7cd5a640834fb63a11d3a316.jpeg)

Does anyone have a solution for this? Any help is appreciated 🙂

---

<div class="post-metadata">

**Author:** ![Libin](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/libin/32/5460_2.png) [@Libin](https://community.make.com/u/Libin)\
**Post date:** [February 22, 2023, 6:01am UTC](https://community.make.com/t/need-advice-with-sum-of-array/8462/2 "2023-02-22T06:01:48Z")

</div>

Hi @Megaphone, you can use Map function to map _package\_value\_p\_\_month_ in “Set Multiple Variable”, or remove all the aggregators and iterator, just connect the list board’s item with the number aggregator. When all the values are in the same array (without having collection), then you can use the number aggregator.

Let me know if it works 🙂

---

<div class="post-metadata">

**Author:** ![EyalGershon](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/eyalgershon/32/6551_2.png) [@EyalGershon](https://community.make.com/u/EyalGershon)\
**Post date:** [February 22, 2023, 7:45am UTC](https://community.make.com/t/need-advice-with-sum-of-array/8462/3 "2023-02-22T07:45:47Z")

</div>

I was playing around, made a dummy structure similar to yours and was able to achieve this with this formula:

{{sum(map(1.Array; “Array[1].mappable\_column\_values.package\_value\_p\_\_month”))}}

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/c/c36a0830edaad07081a6dd50c6892031c083a8ef.png)

Hope this helps.

My input data looks like this:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/d/d7fb6cc8d6f39a4ab23601a19fe18d6db1afe6ef.png)

And when I send that via a webhook and just output the data using a set variable module I get this:  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/2X/a/afe52ef9ce0addcf7950639dd7bc0b15bec81cd3.png)

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [September 7, 2023, 3:38pm UTC](https://community.make.com/t/need-advice-with-sum-of-array/8462/4 "2023-09-07T15:38:56Z")

</div>


