Select to view content in your preferred language

Mismatched Brackets

472
4
06-06-2022 12:52 PM
by
New Contributor

I am writing a calculation for a bunch of variables and keep getting the error about mismatched brackets. I do not see what is wrong since I count that all brackets are there in the right spots. Anybody know what is wrong? I tried this into a simpler one located down below but got the same error.

original:

IF(selected(\${sidewalk},"yes"), (int(\${obscured_adress}) + int(\${broken_windows}) + int(\${yard_debris}) + int(\${untrimmed_yard}) + int(\${roofing_cond}) + int(\${paint_exterior_cond}) + int(\${physical_appearance}) + int(\${sidewalk_kind})) , (int(\${obscured_adress}) + int(\${broken_windows}) + int(\${yard_debris}) + int(\${untrimmed_yard}) + int(\${roofing_cond}) + int(\${paint_exterior_cond}) + int(\${physical_appearance}))

simpler test:

IF(selected(\${sidewalk},"yes"), 1, 0)

4 Replies
MVP Esteemed Contributor

Did you try if it may be case sensitive and not know what IF means.  Just a guess.

Frequent Contributor III

You have 19 start ( and only 18 closing )

Trouble shooing Tip paste it into Word and use the search function to count the number of each.

Esri Contributor

If you highlight a bracket it will show its closing bracket, if it exists...

Esri Notable Contributor

This works for me. I just added an extra parenthesis at the end and replaced IF with if

if(selected(\${sidewalk},"yes"), (int(\${obscured_adress}) + int(\${broken_windows}) + int(\${yard_debris}) + int(\${untrimmed_yard}) + int(\${roofing_cond}) + int(\${paint_exterior_cond}) + int(\${physical_appearance}) + int(\${sidewalk_kind})) , (int(\${obscured_adress}) + int(\${broken_windows}) + int(\${yard_debris}) + int(\${untrimmed_yard}) + int(\${roofing_cond}) + int(\${paint_exterior_cond}) + int(\${physical_appearance})))

Attaching another approach to do this