<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic If Statement in a Calculation in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-a-calculation/m-p/854250#M24339</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have been trying to use a if statement in a calculation based upon the&amp;nbsp;value of a different question. I can't find the answer by browsing topics so could&amp;nbsp;use some help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an alignment code with is an integer within a select one question. If the alignment code is 9 (N/A)&amp;nbsp;then the approach condition should also equal&amp;nbsp;9 (N/A). The approach condition is also an integer. I have tried the following in the calculation column.&lt;/P&gt;&lt;P&gt;if(selected(${alignment_cd},9),9)&lt;/P&gt;&lt;P&gt;If(${alignment_cd}=9, 9)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the approach condition is not getting set. It seems straight forward but I cannot get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Feb 2018 18:53:56 GMT</pubDate>
    <dc:creator>KevinKozak</dc:creator>
    <dc:date>2018-02-09T18:53:56Z</dc:date>
    <item>
      <title>If Statement in a Calculation</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-a-calculation/m-p/854250#M24339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have been trying to use a if statement in a calculation based upon the&amp;nbsp;value of a different question. I can't find the answer by browsing topics so could&amp;nbsp;use some help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an alignment code with is an integer within a select one question. If the alignment code is 9 (N/A)&amp;nbsp;then the approach condition should also equal&amp;nbsp;9 (N/A). The approach condition is also an integer. I have tried the following in the calculation column.&lt;/P&gt;&lt;P&gt;if(selected(${alignment_cd},9),9)&lt;/P&gt;&lt;P&gt;If(${alignment_cd}=9, 9)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the approach condition is not getting set. It seems straight forward but I cannot get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2018 18:53:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-a-calculation/m-p/854250#M24339</guid>
      <dc:creator>KevinKozak</dc:creator>
      <dc:date>2018-02-09T18:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement in a Calculation</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-a-calculation/m-p/854251#M24340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I believe that you want to include an additional variable to the end of your formula.&amp;nbsp; So, for instance, if the alignment_cd = 9 then give me 9, otherwise give me 'x'.&amp;nbsp; Something like this...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt; if(${alignment_cd}=9,9,0)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;This is also outlined in the 'Formulas' section of the documentation linked below...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;A class="link-titled" href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/quickreferencecreatesurveys.htm#ESRI_SECTION1_C60B4E3BBB3B458B98C996F22B2599E2" title="https://doc.arcgis.com/en/survey123/desktop/create-surveys/quickreferencecreatesurveys.htm#ESRI_SECTION1_C60B4E3BBB3B458B98C996F22B2599E2"&gt;Quick reference—Survey123 for ArcGIS | ArcGIS&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Please let me know if this works for you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Brandon&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Feb 2018 21:34:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-a-calculation/m-p/854251#M24340</guid>
      <dc:creator>BrandonArmstrong</dc:creator>
      <dc:date>2018-02-09T21:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement in a Calculation</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-a-calculation/m-p/854252#M24341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with &lt;A href="https://community.esri.com/migrated-users/56560"&gt;Brandon Armstrong&lt;/A&gt;‌. The syntax of your if statement is incomplete.&amp;nbsp; See example below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;if(selected(${alignment_cd},9),9,0)&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If option 9 in the 'alignment_cd' select_one or select_multiple question is selected, then the expression returns 9, otherwise it returns 0&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;if(${alignment_cd}=9,9,0)&amp;nbsp;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; The expression does the same thing, except that the 'alignment_cd' question does not necessarily has to be a select.&lt;/LI&gt;&lt;/UL&gt;&lt;PRE __default_attr="danger" __jive_macro_name="alert" alert="danger" class="jive_text_macro jive_macro_alert" modifiedtitle="true"&gt;&lt;P&gt;If your calculation is set on a select_one question, you will not see the value being set. This is because &lt;STRONG&gt;select_one questions do not support calculations as of 2.6.&lt;/STRONG&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;PRE __default_attr="info" __jive_macro_name="alert" alert="info" class="jive_text_macro jive_macro_alert" modifiedtitle="true"&gt;&lt;P&gt;Support for calculations on select_one questions will start with version 2.7.&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Feb 2018 05:11:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-a-calculation/m-p/854252#M24341</guid>
      <dc:creator>IsmaelChivite</dc:creator>
      <dc:date>2018-02-12T05:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement in a Calculation</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-a-calculation/m-p/854253#M24342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;Hello Brandon and Ismael,&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;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.&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;Thank you,&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="margin: 0in 0in 0pt;"&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Feb 2018 19:20:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-in-a-calculation/m-p/854253#M24342</guid>
      <dc:creator>KevinKozak</dc:creator>
      <dc:date>2018-02-13T19:20:16Z</dc:date>
    </item>
  </channel>
</rss>

