i want to have a calculated filed
if metric name in (OTD, OTP, Storefront availbility) then (num/denom) else num

my current formula is ifelse(in({metric_name},[“OTD %”,“OTP %”,“Storefront Availability %”]),sum({metric_numerator}/sum({metric_numerator}),sum({metric_numerator}))

but i got this error: mismatched aggregation. can someone let me know how to achieve the result i want? thanks