Is it possible to get hourly averages over a period of time with Flux?

Since google pointed me here…
This post: Average per hour - #14 by MarioG shows how to do this.
One thing i would change is to use integral instead of mean in the aggregate window