I am trying to calculate the NEW ELIM AMOUNT column in the sample dataset I attached. For each GroupKey, I want the value of the AMOUNT column to eliminate in column H to the extent of the TOTAL ELIM ALLOWED column. I need to take into consideration amounts in the Elim Amount column that are already calculated.