I have a monthly report that gives me the daily totals for the month. I need to also have a report that gives me the monthly totals for the year.
Below is my monthly script. I could use some help modifying it for monthly totals for the year.
now = system.date.now()
lastMonth = system.date.addDays(now, -1)
system.date.getDayOfMonth(lastMonth)
endTime = system.date.now()
startTime = system.date.getMonth(endTime)-1
startYear = system.date.getYear(endTime)
startDay = system.date.getDate(startYear, startTime, 1)
endDay = system.date.addDays(system.date.getDate(system.date.getYear(now),startTime + 1,1), +0)
returnSize = system.date.daysBetween(startDay,endDay)
tagPaths = ['[IgnitionSQL]abiop_0401_fi',
'[IgnitionSQL]cb_09_fi',
'[IgnitionSQL]ip_02_fi',
'[IgnitionSQL]psp_03_fi']
data['MonthlyData'] = system.tag.queryTagHistory(paths=tagPaths ,returnSize = returnSize, aggregationMode='SimpleAverage', endDate=endDay, startDate=startDay)