# \[Solved\] Reduce a list removing duplicates and summing

**URL:** <https://community.thunkable.com/t/solved-reduce-a-list-removing-duplicates-and-summing/584086>\
**Category:** Questions about Thunkable X\
**Tags:** solved, beginner\
**Created:** [May 22, 2020, 7:59am UTC](https://community.thunkable.com/t/solved-reduce-a-list-removing-duplicates-and-summing/584086 "2020-05-22T07:59:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sirfrancisdrake](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sirfrancisdrake/32/70212_2.png) [@sirfrancisdrake](https://community.thunkable.com/u/sirfrancisdrake)\
**Post date:** [May 22, 2020, 7:59am UTC](https://community.thunkable.com/t/solved-reduce-a-list-removing-duplicates-and-summing/584086/1 "2020-05-22T07:59:40Z")

</div>

hi guys, i would like to submit a question: i have a list done by timestamps and time:  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/a/5ae0d1823e24b9ab8c818bccbea1db8d0438fdda.png)

In picture the list is done by 5 objects and 4 are identical  
I would like to reduce the list (in the case should remain only 2 objects) removing the duplicated objects summing the number into the second object

i tried many ways but no fortune at all. Using C it would takes 2 secs to do it but i’m almost new to thunkableX

Thank you very much

---

<div class="post-metadata">

**Author:** ![jane](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jane/32/27575_2.png) [@jane](https://community.thunkable.com/u/jane)\
**Post date:** [May 22, 2020, 10:28am UTC](https://community.thunkable.com/t/solved-reduce-a-list-removing-duplicates-and-summing/584086/2 "2020-05-22T10:28:27Z")

</div>

Hi there,

Here’s an function which will take a list (firstList) and return a list of only unique entries in that list (cleanList):

 ![cleanUpList](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/5/8530c9b76bd185a82cd8b66661ec146dd37a1471.png)  
You can see this in action in [this app project.](https://x.thunkable.com/projectPage/5ec7a79714e2e0a75572cd36/)

---

<div class="post-metadata">

**Author:** ![sirfrancisdrake](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sirfrancisdrake/32/70212_2.png) [@sirfrancisdrake](https://community.thunkable.com/u/sirfrancisdrake)\
**Post date:** [May 22, 2020, 10:58am UTC](https://community.thunkable.com/t/solved-reduce-a-list-removing-duplicates-and-summing/584086/3 "2020-05-22T10:58:16Z")

</div>

hi @jane ,  
first …thank you for spending your time for it! We are half way.  
If you see my picture, my list is composed by 2values list items: one is a timestamp the other is a number  
My problem was the sum of all the numbers that have the same timestamp…

tks

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [May 22, 2020, 11:16am UTC](https://community.thunkable.com/t/solved-reduce-a-list-removing-duplicates-and-summing/584086/4 "2020-05-22T11:16:58Z")

</div>

CN you describe more what you would like to see. Janes example removed any duplicates and would leave 1 of each unique entry

I see it now. So if there’s 4 copies of some value, the number on the remaining Entry would be the sum of all 4 entries.  
Thanks for the solve but I haven’t fixed anything yet 🙂 that’s all @jane so far 🦾🦾🦾

---

<div class="post-metadata">

**Author:** ![sirfrancisdrake](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sirfrancisdrake/32/70212_2.png) [@sirfrancisdrake](https://community.thunkable.com/u/sirfrancisdrake)\
**Post date:** [May 22, 2020, 12:13pm UTC](https://community.thunkable.com/t/solved-reduce-a-list-removing-duplicates-and-summing/584086/5 "2020-05-22T12:13:18Z")

</div>

I believe it was clear, anyway with a little more effort i found a workaround !!  
Thank you all guys!  
Rob

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:29am UTC](https://community.thunkable.com/t/solved-reduce-a-list-removing-duplicates-and-summing/584086/6 "2024-11-08T11:29:03Z")

</div>


