Hello,
I have been trying to use a if statement in a calculation based upon the value of a different question. I can't find the answer by browsing topics so could use some help.
I have an alignment code with is an integer within a select one question. If the alignment code is 9 (N/A) then the approach condition should also equal 9 (N/A). The approach condition is also an integer. I have tried the following in the calculation column.
if(selected(${alignment_cd},9),9)
If(${alignment_cd}=9, 9)
However, the approach condition is not getting set. It seems straight forward but I cannot get it to work.
Thank you,
Kevin
Hi Kevin,
I believe that you want to include an additional variable to the end of your formula. So, for instance, if the alignment_cd = 9 then give me 9, otherwise give me 'x'. Something like this...
if(${alignment_cd}=9,9,0)
This is also outlined in the 'Formulas' section of the documentation linked below...
Quick reference—Survey123 for ArcGIS | ArcGIS
Please let me know if this works for you.
Brandon
I agree with Brandon Armstrong. The syntax of your if statement is incomplete. See example below:
If your calculation is set on a select_one question, you will not see the value being set. This is because select_one questions do not support calculations as of 2.6.
Support for calculations on select_one questions will start with version 2.7.
Hello Brandon and Ismael,
Thank you for your replies. I had missed the documentation of calculations not working select one questions, which is my situation. Also, I will include the else portion of the if statement next time.
Thank you,
Kevin