My data consists of an array of objects
{
"agent_name": "AgentName",
"analytics": [
{
"date": "Tue, 1 Aug 2021 00:00:00 GMT",
"intents_count":[
{
"count": 5,
"intent": "intent1"
},
{
"count": 1,
"intent": "intent2"
},
{
"count": 0,
"intent": "intent3"
},
]
},
{
"date": "Tue, 2 Aug 2021 00:00:00 GMT",
"intents_count":[
{
"count": 5,
"intent": "intent1"
},
{
"count": 1,
"intent": "intent2"
},
{
"count": 0,
"intent": "intent3"
},
]
},
... and so on for the remaining days of the month
]
}
I am seeking to calculate the cumulative sum of counts for each intent, grouped by date.
The desired output would be:
[10, 2, 0]
This means that 10 corresponds to the total count for 'intent1' across all days.