Hello,

I am trying to query a Historian for total kwh usage.

Every hour, the value changes as the khw is calculated every one hour. So, I think I have a chart like this

Hour 1 333

Hour 1 333

Hour 1 333

Hour 1 333

Hour 2 299

Hour 2 299

Hour 2 299

Hour 2 299

Hour 3 566

Hour 3 566

Hour 3 566

And so on…

I need to sum the new value for every hour for a day, so, the sum of 24 values. Is there a good way I could do this?

I’m using this sort of query right now for other parts:

dataSet = system.tag.queryTagHistory(paths=[‘MSWs/MSB_4/Energy_Incremental_Real_In_Last_Interval/Calculated’], startDate=startTime, endDate=endTime, returnSize=1, aggregationMode=“Maximum”, returnFormat=‘Wide’)

thank you