<?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: Addition Calculations Not Working in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854735#M24454</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would help if you listed what it is doing and what you expect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do see that you are making fields a decimal then using int().&amp;nbsp; This may cut off the decimal places.&amp;nbsp; Also it should not be needed since it is already a number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that does not work I have found setting the bind::type field helps with + a lot and works better than using int() or number().&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also not sure why you have multiple lists for yes/no.&amp;nbsp; You reuse those lists for multiple questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also look into groups and pages to organize this better.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Oct 2019 15:58:01 GMT</pubDate>
    <dc:creator>DougBrowning</dc:creator>
    <dc:date>2019-10-02T15:58:01Z</dc:date>
    <item>
      <title>Addition Calculations Not Working</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854734#M24453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a large form where some fields that are calculated build on each other. I have some pretty basic addition calculations of previous fields I need some of the last fields to complete, that I cannot get to work. There are slightly more complicated conditional statement calculations that work fine, so I'm having a&amp;nbsp;difficult time figuring out why the addition won't work.&lt;/P&gt;&lt;P&gt;In the attached xlsx file, I would like row 443 to sum rows 438 through 442 , row 450 to sum rows 445 through 449, row 457 to sum rows 452 through 456, row 464 to sum rows 459 through 463, and row 471 to sum rows 466 through 470.&amp;nbsp;Currently, nothing appears in these fields, when the sums should be appearing.&amp;nbsp;Any help would be greatly appreciated!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mikala&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2019 13:22:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854734#M24453</guid>
      <dc:creator>MikalaRandich1</dc:creator>
      <dc:date>2019-10-02T13:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Addition Calculations Not Working</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854735#M24454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would help if you listed what it is doing and what you expect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do see that you are making fields a decimal then using int().&amp;nbsp; This may cut off the decimal places.&amp;nbsp; Also it should not be needed since it is already a number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that does not work I have found setting the bind::type field helps with + a lot and works better than using int() or number().&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also not sure why you have multiple lists for yes/no.&amp;nbsp; You reuse those lists for multiple questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also look into groups and pages to organize this better.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2019 15:58:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854735#M24454</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2019-10-02T15:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Addition Calculations Not Working</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854736#M24455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Doug, thanks for your response. I updated the question to hopefully be more specific. I changed the field types to all be integer as well as put 'int' in bind::type, and removed the int() functions from rows 438 - 443 as a test, but row 443 still will not&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;sum rows 438 through 442. As background, the original form was created in the web designer before pulling into Connect, which created the duplicate lists, and I will look into creating groups to better organize the form.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2019 17:41:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854736#M24455</guid>
      <dc:creator>MikalaRandich1</dc:creator>
      <dc:date>2019-10-02T17:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Addition Calculations Not Working</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854737#M24456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mikala,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like your calculations are cascading (i.e., the lines 438-442 all are calculations themselves). &amp;nbsp;Are any of the original values ever blank (and thus NaN - Not a Number)? &amp;nbsp;If so, that would cause an issue with subsequent calculations as &lt;EM&gt;NaN+1 = NaN&lt;/EM&gt; - the blank carries through the rest of the calculation chain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One way to resolve this is to place each of the values in the addition in a &lt;EM&gt;coalesce(${q}, 0)&lt;/EM&gt; function - that will provide a fallback value of 0 if the question is empty.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2019 17:48:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854737#M24456</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2019-10-02T17:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: Addition Calculations Not Working</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854738#M24457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi James, thanks so much for the suggestion! I thought I would have avoided this by entering "0" as the default for the preceding input questions, but the coalesce function solved the problem. Thanks again!!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2019 16:13:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854738#M24457</guid>
      <dc:creator>MikalaRandich1</dc:creator>
      <dc:date>2019-10-04T16:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Addition Calculations Not Working</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854739#M24458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also found a method to convert empty value to 0 if the question is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea is not set bind::esri:fieldType and&amp;nbsp;bind::type for the select_one or calculate question so that the field type is string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use 'number(${previous_question})' to reference the answer in the following question. If&amp;nbsp;${previous_question} is an empty value, &lt;SPAN&gt;number(${previous_question})&lt;/SPAN&gt; will&amp;nbsp;be 0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This method has been working fine but I would like to know if this is a proper method? Will any update in the future alter the behaviour of number(empty value) = 0 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;Sun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Feb 2020 02:14:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854739#M24458</guid>
      <dc:creator>Jing_Sun</dc:creator>
      <dc:date>2020-02-13T02:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Addition Calculations Not Working</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854740#M24459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, the conversion is not likely to change behavior.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2020 22:56:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854740#M24459</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2020-02-19T22:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Addition Calculations Not Working</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854741#M24460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much! I have posted this method along with known limitations for others to reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Sun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2020 23:49:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/addition-calculations-not-working/m-p/854741#M24460</guid>
      <dc:creator>Jing_Sun</dc:creator>
      <dc:date>2020-02-19T23:49:45Z</dc:date>
    </item>
  </channel>
</rss>

