Aggregating Historian Tag Data For Reporting

I’ve got a historian tag logging a value in which I need to aggregate and do some further reporting.

The tag logs a value other then 0 for 8 hour cycles, during that 8 hours I want to take the AVG of 60 second intervals and log this ending with ~480 values. I’m then going to do something else with these values for a report.

Where is the best place to put something like is? I initially thought somewhere in the Global Tag space and track the tag start/stop condition and get the average of all the values that come in and save it in a custom table but I’d like to follow an approach more where I’m using the historian table without the need of manually typing in the start/stop time.