Add time based sum aggregate function.