Helper function for working out a sensible name for aggregated output.