Changed sum calculation to aggregation expression