<?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: calculating multiple select_one field values in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-multiple-select-one-field-values/m-p/771864#M3997</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.  I used the number function and it worked like a charm.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Jan 2020 17:12:35 GMT</pubDate>
    <dc:creator>DavidGriffith2</dc:creator>
    <dc:date>2020-01-30T17:12:35Z</dc:date>
    <item>
      <title>calculating multiple select_one field values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-multiple-select-one-field-values/m-p/771861#M3994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm new to this, so bear with me.&amp;nbsp; I am trying to come up with a total score for six "select_one" type fields.&amp;nbsp; In my choices tab I have given the various responses a unique number (1-10) in the name field.&amp;nbsp; In my calculation field (survey tab) I multiply these times 1.667 to put it on a 100 scale then subtract the number from 100 to give a final score.&amp;nbsp; That's what I want to do.&amp;nbsp; Not working.&amp;nbsp; This is the calculation I used:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;100 - ((${surrounding_area} +&amp;nbsp; ${throat} +&amp;nbsp; ${grate} +&amp;nbsp; ${lid} +&amp;nbsp; ${wall} + ${invert}) * 1.667)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am seeing is the in the calculation of the values (e.g.,)&amp;nbsp;&lt;SPAN&gt;5 + 8 + 0 + 4 + 0 + 6 = 580406, not&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;21.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2020 14:38:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-multiple-select-one-field-values/m-p/771861#M3994</guid>
      <dc:creator>DavidGriffith2</dc:creator>
      <dc:date>2020-01-29T14:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: calculating multiple select_one field values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-multiple-select-one-field-values/m-p/771862#M3995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set the bind:type column to int (or a float if needed).&amp;nbsp; All fields act like strings by default in 123 so the + is a concatenate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need more info search the forum there are several posts on it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Jan 2020 17:47:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-multiple-select-one-field-values/m-p/771862#M3995</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2020-01-29T17:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: calculating multiple select_one field values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-multiple-select-one-field-values/m-p/771863#M3996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addition to Doug's comment, an alternative would be using 'number(${question})' to convert the string to numeric value. And you don't need to set the&amp;nbsp;bind:type column to int, just leave it as it is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So something like this:&amp;nbsp;&lt;SPAN&gt;number(&lt;/SPAN&gt;${surrounding_area}) +&amp;nbsp;&lt;SPAN&gt;number(&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;${throat}) +&amp;nbsp;&lt;SPAN&gt;number(${grate}&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;) ...&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; "&gt;I was using the method (setting&amp;nbsp;bind:type column to int) before and found that if the question is an optional question and user did not answer the question, it will return an empty value (NaN). The following calculation would fail if there's an empty value (&lt;SPAN style="color: #4c4c4c;"&gt;NaN)&amp;nbsp;&lt;/SPAN&gt;in the calculation.&amp;nbsp;&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;However, if the question type hasn't been set to int or decimal (i.e. leave it as it is), the empty value that it will return is an empty string. number(${question}) will read the empty string as 0 so it will have no impact on the calculation.&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 see the 'Empty values' section for more information:&amp;nbsp;&lt;A class="link-titled" href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm" title="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm"&gt;Formulas—Survey123 for ArcGIS | Documentation&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; "&gt;My recommendation is, if there's no optional question, use Doug's method, otherwise you can consider using the method I described.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; "&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; "&gt;Sun&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 00:33:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-multiple-select-one-field-values/m-p/771863#M3996</guid>
      <dc:creator>Jing_Sun</dc:creator>
      <dc:date>2020-01-30T00:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: calculating multiple select_one field values</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-multiple-select-one-field-values/m-p/771864#M3997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.  I used the number function and it worked like a charm.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jan 2020 17:12:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-multiple-select-one-field-values/m-p/771864#M3997</guid>
      <dc:creator>DavidGriffith2</dc:creator>
      <dc:date>2020-01-30T17:12:35Z</dc:date>
    </item>
  </channel>
</rss>

