How to sum part of collections

So I’m a little bit stck how to do this, I know like the aggretors but can’t sum it up to make it work.

So I have this:

[
    {
        "array": [
            {
                "CONTACT.NAME": "Person1 ",
                "DT": "2025-05-15T12:15:00",
                "DURATION": "1.5",
                "TASK.PROJECT.EXTID": "100",
                "TASK.PROJECT.NAME": "Project100",
            },
            {
                "CONTACT.NAME": "Person2",
                "DT": "2025-05-15T11:00:00",
                "DURATION": "0.5",
                "TASK.PROJECT.EXTID": "100",
                "TASK.PROJECT.NAME": "Project100",
            },
            {
                "CONTACT.NAME": "Person2",
                "DT": "2025-05-15T11:30:00",
                "DURATION": "0.5",
                "TASK.PROJECT.EXTID": "100",
                "TASK.PROJECT.NAME": "Project100",
            },
            {
                "CONTACT.NAME": "Person2",
                "DT": "2025-05-15T11:30:00",
                "DURATION": "0.5",
                "TASK.PROJECT.EXTID": "200",
                "TASK.PROJECT.NAME": "Project200",
            }
        ]
    }
]

I want to send a message to someone that on his or her project(s) these people are working on a specific project but the issue is that we have multiple items of Person2 on the same project (that’s needs to be summed) and Person2 is working on other projects (which makes it harder to sum I think).

So the structure is, I think:
Project
Person who is working on it - How many hours total
Person who is working on it - How many hours total
Person who is working on it - How many hours total

Project
Person who is working on it - How many hours total
Person who is working on it - How many hours total
Person who is working on it - How many hours total

etc.

I get stuck with the sums and way to do it as it’s summing the total of hours of that person but it needs to project specific or on the otherside I get all the project hours but not per person on the project. I need to create like a extra level which I don’t know how to do.

In the end I will use this info to check the project name with the project name on a list that has the name of the person who needs to get this information with like a Slack ID and send him one big message which all his or her projects that will be worked on today.

Thanks so much for any help!

Hey there,

so you want to group them by Project first, and then see how much time each person is spending per project?

Here
blueprint.json (7.5 KB)

You iterate the master array and then aggregate it but you group it by the task project name. This will give you one new array for each different project. Then you iterate the new array and numerically aggregate it grouping by contact name and summing the duration. This will give you total time spent on this specific task per person that was part of it.

Hi,

Thanks for the json, it helped me to just understand the order.

In the end I would like that, yes, but not sure if you need to do that in that order.

Is it possible to merge collections based on same name + project name at the start?

As you iterate again, it checks every item (I have like 50 items), so I have 100 operations to sum the duration. Also it checks items which do not have same name in it, which he does not really has to check.

Afterwards I need to merge the total hours back to the project, which also cost 50 operations again.

Is there cost effective way or is this just it? I already though of putting a filter when summing up, as like when it has multiple arrays, so if a project has one person working on it it will not continue, but that’s not really it.