<?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 question in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-question/m-p/800933#M10772</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phillip,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifically the calculation in the M312 cell -&amp;nbsp; CalculateTotalEstimate is not working.&amp;nbsp; There is not an error message it's just not calculating.&amp;nbsp; The confusing part is that I haven't changed anything in XLS.&amp;nbsp; The only thing that has changed are updating the version of Survey123 Connect and updating to the latest version of the app and iOS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; "&gt;What Connect version was the survey published with?&lt;/EM&gt;&lt;SPAN style="background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;I am not sure which version the survey was published with. I published it a while ago&lt;/STRONG&gt;&lt;SPAN style="background-color: #ffffff;"&gt;,&lt;/SPAN&gt;&lt;EM style="background-color: #ffffff; "&gt; and what app version are you using?&amp;nbsp;&lt;/EM&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;STRONG&gt;3.6.155&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;EM style="background-color: #ffffff; "&gt; Also on what OS? &lt;/EM&gt;&lt;STRONG style="background-color: #ffffff; "&gt;iOS version 13.1.2&lt;/STRONG&gt;&lt;EM style="background-color: #ffffff; "&gt;&amp;nbsp;Does the same issue happen on all OS?&amp;nbsp;&lt;/EM&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;STRONG&gt;I've used this survey on multiple devices and am having the same issue.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Oct 2019 11:24:35 GMT</pubDate>
    <dc:creator>SarahLinn1</dc:creator>
    <dc:date>2019-10-04T11:24:35Z</dc:date>
    <item>
      <title>Calculation question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-question/m-p/800931#M10770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a survey that is long and has multiple calculations in it.&amp;nbsp; It was working fine until I updated to the latest version on Survey123 Conntect, was there something in this last update that could have potentially affected the calculations in the form? The form is attached.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2019 15:54:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-question/m-p/800931#M10770</guid>
      <dc:creator>SarahLinn1</dc:creator>
      <dc:date>2019-10-03T15:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-question/m-p/800932#M10771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sarah,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had a quick look at your survey xlsx form are do not see anything obvious? I see you are using many relevant statements, calculations, hidden etc. Can you be more specific about which calculations from which questions are not working? Are you able to take screenshots or record the behaviour?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What Connect version was the survey published with, and what app version are you using? Also on what OS? Does the same issue happen on all OS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2019 06:18:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-question/m-p/800932#M10771</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-10-04T06:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-question/m-p/800933#M10772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Phillip,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifically the calculation in the M312 cell -&amp;nbsp; CalculateTotalEstimate is not working.&amp;nbsp; There is not an error message it's just not calculating.&amp;nbsp; The confusing part is that I haven't changed anything in XLS.&amp;nbsp; The only thing that has changed are updating the version of Survey123 Connect and updating to the latest version of the app and iOS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff; "&gt;What Connect version was the survey published with?&lt;/EM&gt;&lt;SPAN style="background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;STRONG&gt;I am not sure which version the survey was published with. I published it a while ago&lt;/STRONG&gt;&lt;SPAN style="background-color: #ffffff;"&gt;,&lt;/SPAN&gt;&lt;EM style="background-color: #ffffff; "&gt; and what app version are you using?&amp;nbsp;&lt;/EM&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;STRONG&gt;3.6.155&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;EM style="background-color: #ffffff; "&gt; Also on what OS? &lt;/EM&gt;&lt;STRONG style="background-color: #ffffff; "&gt;iOS version 13.1.2&lt;/STRONG&gt;&lt;EM style="background-color: #ffffff; "&gt;&amp;nbsp;Does the same issue happen on all OS?&amp;nbsp;&lt;/EM&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;STRONG&gt;I've used this survey on multiple devices and am having the same issue.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2019 11:24:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-question/m-p/800933#M10772</guid>
      <dc:creator>SarahLinn1</dc:creator>
      <dc:date>2019-10-04T11:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-question/m-p/800934#M10773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sarah,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to find why the M312 calculation appears not to be working. The reason is due to that in the 3.6 we fixed a bug (&lt;A href="https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDA5NzEwNQ=="&gt;BUG-000097105&lt;/A&gt;)&amp;nbsp;where &lt;EM&gt;default&lt;/EM&gt; values in non-relevant questions where being stored incorrectly, this should not occur as the question is not relevant so should not have any value until it becomes relevant. In your case, you are using a &lt;EM&gt;default&lt;/EM&gt; of 0 for all your calculation questions in each group and then trying to sum them all together, even if they are not relevant. This worked in 3.5 or earlier, as all those questions would have had a value of 0 stored even when not relevant, however now with 3.6, the non-relevant&amp;nbsp;questions will be null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In M312 you are simply adding the values together using a simple addition expression (value1+value2+value3...etc), where each question much have a value, as you can not add a value and null together. In 3.6 the expression&amp;nbsp;will not work as you are relying on the answers from all the non-relevant questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The correct way to construct the M312 calculation is to use &lt;EM&gt;&lt;STRONG&gt;coalescse(${calc1},0)&lt;/STRONG&gt;&lt;/EM&gt; for each question you want to add together in the final total calculation. Updated calculation below for M312, I tested this out with your form and works as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see you asked this same question back in April 2019, and James replied with the same explanation and suggestion to use &lt;EM&gt;coalesce()&lt;/EM&gt;:&amp;nbsp;&lt;A href="https://community.esri.com/thread/232505"&gt;Survey123 Calculations not calculating &lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Secondly, I noticed you are using relevant&amp;nbsp;expressions on both the &lt;EM&gt;begin group&lt;/EM&gt; and questions in the group&amp;nbsp;with the exact same expression. This is no longer required, with 3.6 we fixed an issue where the questions inside a group were not inheriting the relevant expression of the &lt;EM&gt;begin group&lt;/EM&gt; correctly. This now works, so you only need the expression on the &lt;EM&gt;begin group&lt;/EM&gt;, and all questions will&amp;nbsp;become relevant and be displayed when the group becomes relevant. By removing all the un-needed expressions on all the questions, this speeds up the form load time, I noticed it was 1-2 secs faster.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thirdly, I also noticed that you have used the &lt;EM&gt;minimal&lt;/EM&gt; appearance on &lt;EM&gt;decimal&lt;/EM&gt; and &lt;EM&gt;hidden&lt;/EM&gt; question types. This appearance does not apply to these types of questions so should be removed to avoid any unforeseen issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached the xlsx file I&amp;nbsp;modified and it appears to be working&amp;nbsp;with some of those improvements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;coalesce(${CalcRCP24Cost},0)+coalesce(${CalcRCP18Cost},0)+coalesce(${CalcCMP36Cost},0)+coalesce(${CalcCMP24Cost},0)+coalesce(${CalcCMP18Cost},0)+coalesce(${CalcHDPE36Cost},0)+coalesce(${CalcHDPE24Cost},0)+coalesce(${CalcHDPE18Cost},0)+coalesce(${CalcCleanCulvertOver24Cost},0)+coalesce(${CalcCleanCulvert0_24Cost},0)+coalesce(${CalcPavementExcavationCost},0)+coalesce(${CalcExcavationCost},0)+coalesce(${CalcDebrisHauledCost},0)+coalesce(${CalcCatchBasinCost},0)+coalesce(${CalcDitchCost},0)+coalesce(${CalcBoxGuardrailCost},0)+coalesce(${CalcSteelGuardrailCost},0)+coalesce(${CalcRemoveGuardrailCost},0)+coalesce(${CalcRipRapHeavyCost},0)+coalesce(${CalcStoneFillTypeIVCost},0)+coalesce(${CalcStoneFillTypeIIICost},0)+coalesce(${CalcStoneFillTypeIICost},0)+coalesce(${CalcStoneFillTypeICost},0)+coalesce(${CalcBitConcreteSurfCourseCost},0)+coalesce(${CalcsubbaseCost},0)+coalesce(${CalcGranularBorrowCost},0)+coalesce(${CalcGranularBackfillCost},0)+coalesce(${CalcAggSurfaceCourseCost},0)+coalesce(${CalcGrubbingCost},0)+coalesce(${CalcPortlandCementSidewalkCost},0)+coalesce(${CalcConcreteClassBCost},0)+coalesce(${CalcStoneDitchProtectionCost},0)+coalesce(${CalcTopSoilSeedingCost},0)+coalesce(${CalcDisposeGuardrailCost},0)+coalesce(${CalcFlaredTerminalSectionCost},0)+coalesce(${CalcTangentTerminalSectionCost},0)+coalesce(${CalcTrafficBarrierCost},0)+coalesce(${CalcMoveTrafficBarrierCost},0)+coalesce(${CalcDebrisROWChipsCost},0)+coalesce(${CalcChannelExcavationCost},0)+coalesce(${OtherEstimate},0)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Phil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Oct 2019 05:41:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-question/m-p/800934#M10773</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-10-07T05:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation question</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculation-question/m-p/800935#M10774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Phillip. That worked great.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Oct 2019 15:49:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculation-question/m-p/800935#M10774</guid>
      <dc:creator>SarahLinn1</dc:creator>
      <dc:date>2019-10-08T15:49:25Z</dc:date>
    </item>
  </channel>
</rss>

