Create a sum query in analysis

Create a sum query in analysis

I have the current code, where i wish to sum all the occurrences of the
Event_Number variable in the last 3 months. Unfortunately, the sum query returns undefined.
Note: I do not wish to count the number of times the variable appears, i want to sum its values.
Example: Event_Number[0] = 2 Event_Number[1] = 15 Event_Number[2] = 0
Total = 17(2+15+0)


const
Analysis = require('tago/analysis');
const Utils = require('tago/utils');
const Device = require('tago/device');

async function myAnalysis(context) {
const device = new Device('YOUR_DEVICE_TOKEN_HERE'); // YOUR_DEVICE_TOKEN_HERE
let count_events;
count_events = await device.find({
'query': 'sum',
'start_date': '3 month', // replace '1 day' interval to your choosing
'variable': 'Event_Number',
})
}