# Using SUM() agregation in a custom list

**URL:** <https://forum.adalo.com/t/using-sum-agregation-in-a-custom-list/31026>\
**Category:** Database\
**Created:** [August 20, 2022, 10:00pm UTC](https://forum.adalo.com/t/using-sum-agregation-in-a-custom-list/31026 "2022-08-20T22:00:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcio](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@marcio](https://forum.adalo.com/u/marcio)\
**Post date:** [August 20, 2022, 10:00pm UTC](https://forum.adalo.com/t/using-sum-agregation-in-a-custom-list/31026/1 "2022-08-20T22:00:15Z")

</div>

Hello,

I´ve built a list with Project records… Each Project may have 1:N tasks and each task will have a number field used as cost/currency.

In the Project list I´ve added a component and set the Magic Text as Sum of all Project \> Tasks.cost. My expectation is that each List row would display only its project specific task costs but it is adding ALL task costs in ALL rows.

![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/5/c/5c7e000edc73993ecdee4d3f2ff4170c85c31bde.png)

Project Row 1 total is 4.5K  
Project Row 2 total is 5K

What I am doing wrong ?

Here is my component config

![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/1/5/15b0b4a028627fd86d9eef4c8944abccc3b05598.png)

Thank you and Regards

Márcio

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [August 20, 2022, 10:25pm UTC](https://forum.adalo.com/t/using-sum-agregation-in-a-custom-list/31026/2 "2022-08-20T22:25:23Z")

</div>

Hi @marcio ,

If you think that you hit a limit, probably a good idea to have workaround which is to add another filter based on logged in user email.

Another way of looking at it is any projects associated to logged in user will be summed up regardless the child collections are associated or not from previous filter.

---

<div class="post-metadata">

**Author:** ![marcio](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@marcio](https://forum.adalo.com/u/marcio)\
**Post date:** [August 20, 2022, 11:09pm UTC](https://forum.adalo.com/t/using-sum-agregation-in-a-custom-list/31026/3 "2022-08-20T23:09:30Z")

</div>

Hello @Yongki , I dont think I hit a limitation, no. I think I am doing something incorrect.  
I´ve done a new test, adding a simple text in my Projects screen instead and added the same magic text definition. Same results

![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/6/0/60269e7ebc66b39204a87f5b771daefa8b4e6f11.png)

If I am doing it correctly, then it may be a bug ?

I also did a count() instead and that way it worked… Adding 3 rows

![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/6/e/6e8bff1ab12bdee1cc80c7ee1ff8d15631fefb1d.png)

Thank you

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [August 21, 2022, 1:16am UTC](https://forum.adalo.com/t/using-sum-agregation-in-a-custom-list/31026/4 "2022-08-21T01:16:54Z")

</div>

Hello Márcio,

I believe you need to add Current Project \> Tasks \> price \> sum and not Logged in user’s \> Projects \> Tasks \> price \> sum because it’s only one for logged in user and that will show on every list item.

Thank you

---

<div class="post-metadata">

**Author:** ![marcio](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@marcio](https://forum.adalo.com/u/marcio)\
**Post date:** [August 21, 2022, 1:57am UTC](https://forum.adalo.com/t/using-sum-agregation-in-a-custom-list/31026/5 "2022-08-21T01:57:02Z")

</div>

Hello @Dilon Superb !!!

That was it indeed, Thank you !

![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/6/f/6f8830e94ee97c6215da76986a96e8e5eb2c0052.png)
