For calculating aggregates