Merge and Sum

Hello everyone in the community!

I’ve spent few hours to tried to merge and sum few values but I’ve reach the limit of my skills I presum.

It’s what I have:

{
"Project ID":
"637b55618a88f90b3a29341d",
"Project Name":
"M2CCaas-iControl-prd",
"Period":
"2023-02-01T00:00:00Z",
"Consumed":
27.144
},
{
"Project ID":
"637b55618a88f90b3a29341d",
"Project Name":
"M2CCaas-iControl-prd",
"Period":
"2023-02-01T00:00:00Z",
"Consumed":
2.9036712328767127
},
{
"Project ID":
"637b55618a88f90b3a29341d",
"Project Name":
"M2CCaas-iControl-prd",
"Period":
"2023-02-01T00:00:00Z",
"Consumed":
28.4054794520548
},

and it’s what I would like to have:

{
"Project ID":
"637b55618a88f90b3a29341d",
"Project Name":
"M2CCaas-iControl-prd",
"Period":
"2023-02-01T00:00:00Z",
"Consumed":
58.44
},

I would like to merge all values if sames and sum the cost column

Is that something I can achieve "easily’ with N8N ?

Thanks a lot for your help !

Hey @Robvred,

Welcome to the community :tada:

I have had a quick play and it looks like the Item Lists node can do this if you use the Summarize operation.

As an example I have taken your test data and modified one of the items to give it a different project id and project name and this was the result.

4 Likes

Hi @Jon

Thanks a lot ! I’ve been using N8N since 1 year now, and I’ve never payed attention to the scroll bar… :unamused:

I feel a little ashamed …

Thanks again for your help !

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.