do(
// in.PAYMENT_AMOUNT contains a value for each record in the group
// Each value is passed in one by one using $amount
forEach( $amount, in.PAYMENT_AMOUNT,
// Check if the value is positive
if($amount > 0,
//Add the $amount to the $totalPositive for each value in in.PAYMENT_AMOUNT
$totalPositive = $totalPositive + $amount
)
),
$totalPositive
)