I want to perform aggregation operations only on individual rows in a multirow when the condition is met