Lookerstudio limit to calculated field?

Hi all,

I have a problem with IF statements in calculated fields.

this works:
IF(ab_chi_second>9.21, 0.99, IF(ab_chi_second>5.99 , 0.95, IF(ab_chi_second>4.61, 0.9, IF(ab_chi_second>3.79, 0.85, IF(ab_chi_second>3.22, 0.80, IF(ab_chi_second>2.77, 0.75, IF(ab_chi_second>2.41, 0.70, IF(ab_chi_second>2.11, 0.65, IF(ab_chi_second>1.85, 0.60, IF(ab_chi_second>1.64, 0.55, IF(ab_chi_second>1.39, 0.55, 0.5)))))))))))

But if I add one more IF statement, it says “Formula error”

so this all of a sudden does not work:
if(ab_anzahl_variants=3,
IF(ab_chi_second>9.21, 0.99, IF(ab_chi_second>5.99 , 0.95, IF(ab_chi_second>4.61, 0.9, IF(ab_chi_second>3.79, 0.85, IF(ab_chi_second>3.22, 0.80, IF(ab_chi_second>2.77, 0.75, IF(ab_chi_second>2.41, 0.70, IF(ab_chi_second>2.11, 0.65, IF(ab_chi_second>1.85, 0.60, IF(ab_chi_second>1.64, 0.55, IF(ab_chi_second>1.39, 0.55, 0.5)))))))))))
,0)

Is it possible that there is a max limit of characters to a calculated field?
or a maximum number of nested IF statements?

Any other ideas?

Hi @shoplytics

You should consider to replace your if cascade with a CASE WHEN statement. It would fit to your need with higher threshold for the number of cases and a better readibility.

https://support.google.com/looker-studio/answer/7020724#zippy=%2Cin-this-article

Mehdi