I am trying to use multiple if statements in the calculate field of an xls form to populate a field. The1st if statement executes correctly but the 2nd statement in bold does not execute when the CAT_4 is selected in the RMZ_CLASS field. I know it has to do with the way the statement is structured but I cannot figure it out.
if(selected(${RMZ_CLASS}, 'CAT_1') or selected(${RMZ_CLASS}, 'CAT_2') or selected(${RMZ_CLASS}, 'CAT_3'), ('100 Feet'), '0 Feet' or if(selected(${RMZ_CLASS},'CAT_4'),('50 Feet'),'0 Feet'))
When I choose CAT_1, 2, or 3 in the list '100 Feet' is returned in the field, but if I choose CAT_4, '0 Feet' is returned, when it should return '50 Feet'.
Anyone have ideas where I am going wrong?
Thanks!
Solved! Go to Solution.
It's the way you've put the if statement as a condition. Might be better to put it as a nested if statement in the original 'else'. If(logic,value,else)
if(selected(${RMZ_CLASS}, 'CAT_1') or selected(${RMZ_CLASS}, 'CAT_2') or selected(${RMZ_CLASS}, 'CAT_3'), '100 Feet',
if(selected(${RMZ_CLASS}, 'CAT_4'), '50 Feet', '0 Feet'))
It's the way you've put the if statement as a condition. Might be better to put it as a nested if statement in the original 'else'. If(logic,value,else)
if(selected(${RMZ_CLASS}, 'CAT_1') or selected(${RMZ_CLASS}, 'CAT_2') or selected(${RMZ_CLASS}, 'CAT_3'), '100 Feet',
if(selected(${RMZ_CLASS}, 'CAT_4'), '50 Feet', '0 Feet'))
Thank you!