Include division in ifelse calculation

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

Hi @Iris_Zhou ,
did you tried it without the sum()?

hi @ErikG without sum, the result is not correct

both metric_num and metric_denom are binary value(1/0)

But is the formula working?

hi Erik, your formula didn’t work, this formula works for my case if anyone in the future has the same question






1 Like