Get sum of grouped items

I have a collection of stock issues and I want to create a graph with the following information

labelProduct
amount

{“product”: Álcool, “quantidade”:122, “total”: 2.32}

I managed to group by product name, but I need to add up all the quantities. How do I do this?

image

I would copy/paste exactly your question inside our AI copilot feature, it should be able to generate to appropriate code. Its not easy to do in a formula way yet so it may require a little bit of javascript.

Give it a try and let me know if it doesn’t solve your issue :slight_smile:

I had it created by IA, but I don’t know what happened that lost the parameters. Since then I have tried to create and no values ​​appear. See the photo
the value returns empty

image

Could you share the code here please ? You can put a codeblock using three `

I opened a ticket. I shared the project there

So, the generated javascript code worked at some point and doesn’t work anymore ?

It worked properly. One day I went in and it wasn’t working anymore. Unfortunately I don’t have that code saved. But for several days I tried to create a new one and I couldn’t

For some reason, copilot is not including wwFormulas and this has given an error. @mauromequelussi helped me and I managed to resolve.