<?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: sum() Aggregate function doesn't add values properly in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/sum-aggregate-function-doesn-t-add-values-properly/m-p/793216#M8739</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without seeing the XLS file, I can't be sure, but this sounds like expected behavior since you are not loading the existing records via the Inbox. &amp;nbsp;When a form is loaded from the Inbox, questions with calculations have their value&amp;nbsp;compared against the calculated value; if different, the calculation is disengaged from the question and the value retained. &amp;nbsp;This is done from the presumption that the existing value was manually input to override the calculation. &amp;nbsp;If you're loading the form without the previous values, the question with sum() will clearly not equal the sum() calculation (which would be 0). &amp;nbsp;There are a couple of ways to get the behavior (a running total) you want:&lt;/P&gt;&lt;P&gt;- load the &lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/prepareforediting.htm#ESRI_SECTION1_80CFFC9C38654DC293D4F36C5376C62E"&gt;existing repeats in by using the &lt;EM&gt;query&lt;/EM&gt;&amp;nbsp;keyword&lt;/A&gt; in the bind::Esri:parameters column along with the allowUpdates&lt;/P&gt;&lt;P&gt;- Generate the running total dynamically using Arcade via the &lt;A href="https://www.esri.com/arcgis-blog/products/mapping/mapping/whats-new-with-arcade-taking-a-stroll-through-featuresets-part-1/"&gt;FeatureSet functionality&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 31 Mar 2020 21:52:41 GMT</pubDate>
    <dc:creator>JamesTedrick</dc:creator>
    <dc:date>2020-03-31T21:52:41Z</dc:date>
    <item>
      <title>sum() Aggregate function doesn't add values properly</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/sum-aggregate-function-doesn-t-add-values-properly/m-p/793215#M8738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've created a survey that assists crop specialists with tracking counts of Cereal Leaf Beetle.&amp;nbsp; I have two parts to the survey: the first part that collects information regarding the field location, crop type, tillage, etc and the second part being a series of repeated questions related to the different stages of the crop based on the time of scouting and most importantly the observed counts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As part of the first section of the survey, outside of the "repeat", I have an sum() aggregate function that acts as a running total. If I add multiple counts at the original time of data collection it works perfectly.&amp;nbsp; But the way I set this survey up is to allow the users to come back to the same field, multiple times throughout the growing season, and update their counts.&amp;nbsp; I've done this by enabling the Inbox and setting up my Repeats to&amp;nbsp;allowAdds=true.&amp;nbsp; This is where my problem comes in.&amp;nbsp; When I add new counts, the sum() does not update to take in to account those recently adding values.&amp;nbsp; Only the latest counts are displayed in the sum fields.&amp;nbsp; They are not added to the totals&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I trigger the sum() function to incorporate these newly added values?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your assistance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Mar 2020 16:14:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/sum-aggregate-function-doesn-t-add-values-properly/m-p/793215#M8738</guid>
      <dc:creator>DanBihari</dc:creator>
      <dc:date>2020-03-27T16:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: sum() Aggregate function doesn't add values properly</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/sum-aggregate-function-doesn-t-add-values-properly/m-p/793216#M8739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without seeing the XLS file, I can't be sure, but this sounds like expected behavior since you are not loading the existing records via the Inbox. &amp;nbsp;When a form is loaded from the Inbox, questions with calculations have their value&amp;nbsp;compared against the calculated value; if different, the calculation is disengaged from the question and the value retained. &amp;nbsp;This is done from the presumption that the existing value was manually input to override the calculation. &amp;nbsp;If you're loading the form without the previous values, the question with sum() will clearly not equal the sum() calculation (which would be 0). &amp;nbsp;There are a couple of ways to get the behavior (a running total) you want:&lt;/P&gt;&lt;P&gt;- load the &lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/prepareforediting.htm#ESRI_SECTION1_80CFFC9C38654DC293D4F36C5376C62E"&gt;existing repeats in by using the &lt;EM&gt;query&lt;/EM&gt;&amp;nbsp;keyword&lt;/A&gt; in the bind::Esri:parameters column along with the allowUpdates&lt;/P&gt;&lt;P&gt;- Generate the running total dynamically using Arcade via the &lt;A href="https://www.esri.com/arcgis-blog/products/mapping/mapping/whats-new-with-arcade-taking-a-stroll-through-featuresets-part-1/"&gt;FeatureSet functionality&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Mar 2020 21:52:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/sum-aggregate-function-doesn-t-add-values-properly/m-p/793216#M8739</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2020-03-31T21:52:41Z</dc:date>
    </item>
  </channel>
</rss>

