<?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 Re: Calculation and Conditional Statements in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-and-conditional-statements/m-p/776900#M5201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my original question I thought I needed to specify for each question if the response is N/A then designate that&amp;nbsp;value as 0 (using commas between if statements) before adding the values together. I then found the best way to accomplish this task was to combine it all into one if statement&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;STRONG&gt;if(selected(${question1}, 'NA'), 0, int(${question1})) &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;+ additional questions.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;One additional note is that since I'm using number 0-3 in 0.5 increments instead of converting to an integer&amp;nbsp;&lt;STRONG&gt;int(${question1})&lt;/STRONG&gt; my list values&amp;nbsp;should be converted to a number.&lt;STRONG&gt;&amp;nbsp;number(${question1}).&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I will adjust my answer accordingly.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Aug 2017 16:45:30 GMT</pubDate>
    <dc:creator>AngelaBozeman</dc:creator>
    <dc:date>2017-08-15T16:45:30Z</dc:date>
    <item>
      <title>Calculation and Conditional Statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-and-conditional-statements/m-p/776895#M5196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am looking to sum the total of multiple questions within my survey and divide by the number of questions answered but the problem is the answer can also be N/A. I figured out a way to get the total number of N/A and subtract that number from the total # of questions to get the number to divide by.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;Example:&lt;/SPAN&gt; If there are 5 questions total my equation looks like&lt;/P&gt;&lt;P&gt;5 - (if(selected(${question1}, 'NA', 1, 0) + if(selected(${question2}&lt;SPAN&gt;, 'NA', 1, 0)....repeated for each question)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This portion works fine. The issue is I haven't found a way to sum the values where there is a non-numeric value in the mix. When using a simple addition equation the answer&amp;nbsp;always = 0 when any of the questions are answered N/A.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN style="text-decoration: underline;"&gt;I tried using an if statement&lt;/SPAN&gt;:&amp;nbsp;if(selected(${question1}, 'NULL'), 0, ${question1}) to make the N/A value = 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This works for each&amp;nbsp;question individually but when I try to&amp;nbsp;combine this line for all 5 questions by using a comma between it doesn't work. I also tried using parenthesis&amp;nbsp;around each equation and one around the entire group.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The calculation&amp;nbsp;I am ultimately trying to achieve can be seen in the attachment.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please help and let me know if there is a better way to accomplish the same task. Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 16:05:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-and-conditional-statements/m-p/776895#M5196</guid>
      <dc:creator>AngelaBozeman</dc:creator>
      <dc:date>2017-08-14T16:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation and Conditional Statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-and-conditional-statements/m-p/776896#M5197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I found a way to make this calculation work. It may not be the best way, but I obtain the desired result.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;I used&lt;/SPAN&gt;:&lt;/P&gt;&lt;P&gt;if(selected(${question1}, 'NA'), 0, number(${question1})) + if(selected(${question2}, 'NA'), 0, number(${question2}).....repeat for all questions)&lt;/P&gt;&lt;P&gt;I can then divide by the number calculated&amp;nbsp;in the working function above.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 20:44:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-and-conditional-statements/m-p/776896#M5197</guid>
      <dc:creator>AngelaBozeman</dc:creator>
      <dc:date>2017-08-14T20:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation and Conditional Statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-and-conditional-statements/m-p/776897#M5198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Angela,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you describe how your choice list looks? &amp;nbsp;In particular, is 0 a valid value for people to enter? &amp;nbsp;If not, I would reassign 'N/A' to 0 - having all numeric answers would make what you're trying to do easier, I think.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Aug 2017 23:12:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-and-conditional-statements/m-p/776897#M5198</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2017-08-14T23:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation and Conditional Statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-and-conditional-statements/m-p/776898#M5199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Valid entries are 0-3 in intervals of 0.5. So unfortunately assigning a value of 0 will not work. This is why I need&amp;nbsp;a N/A option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 01:48:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-and-conditional-statements/m-p/776898#M5199</guid>
      <dc:creator>AngelaBozeman</dc:creator>
      <dc:date>2017-08-15T01:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation and Conditional Statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-and-conditional-statements/m-p/776899#M5200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I was guessing this might be the case. &amp;nbsp;In re-reading through your description above, I'm not quite sure what you mean by "&lt;SPAN style="background-color: #ffffff;"&gt;when I try to&amp;nbsp;combine this line for all 5 questions by using a comma between it doesn't work." &amp;nbsp;If you're trying to combine the if(selected()) together, you would want to add them together, correct?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 15:27:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-and-conditional-statements/m-p/776899#M5200</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2017-08-15T15:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation and Conditional Statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-and-conditional-statements/m-p/776900#M5201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my original question I thought I needed to specify for each question if the response is N/A then designate that&amp;nbsp;value as 0 (using commas between if statements) before adding the values together. I then found the best way to accomplish this task was to combine it all into one if statement&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;STRONG&gt;if(selected(${question1}, 'NA'), 0, int(${question1})) &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;+ additional questions.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;One additional note is that since I'm using number 0-3 in 0.5 increments instead of converting to an integer&amp;nbsp;&lt;STRONG&gt;int(${question1})&lt;/STRONG&gt; my list values&amp;nbsp;should be converted to a number.&lt;STRONG&gt;&amp;nbsp;number(${question1}).&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;I will adjust my answer accordingly.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Aug 2017 16:45:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-and-conditional-statements/m-p/776900#M5201</guid>
      <dc:creator>AngelaBozeman</dc:creator>
      <dc:date>2017-08-15T16:45:30Z</dc:date>
    </item>
  </channel>
</rss>

