My dataset is like this:
metric_name, Denominator, Numerator
For metric name= M1, I want to use sum(Numerator)/sum(Denominator)
For metric name= M2, I want to use sum(Numerator)/MAx(Denominator)
I am trying to write something like this:
ifelse(
contains(metric_name, ‘Contri’),
sum(num_wk0) / max(dnm_wk0),
sum(num_wk0) / sum(dnm_wk0)
)
but getting error– QuickSight doesn’t allow mixing aggregated fields (like sum(), max()) with non-aggregated fields (like metric_name) in the same calculated field.
how to fix it?