<?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 multiple fields in Survey123 report in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/sum-multiple-fields-in-survey123-report/m-p/1566130#M60403</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/116479"&gt;@ZenMasterZeke&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The `stats` syntax utilizes the &lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer/#:~:text=groupByFieldsForStatistics%3DSTATE_NAME%2C%20GENDER-,outStatistics,-The%20definitions%20for" target="_self"&gt;outStatistics parameter of the /query operation&lt;/A&gt;, and can only calculate statistics for one field. The # sign means there are multiple values here, and you can iterate each one in the report.&lt;/P&gt;
&lt;P&gt;In your case, since you can ensure there is only one number (not multiple values) in the stats result, so the syntax can be simplified from&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;${#MySurvey | stats: “sum, male_interact, &amp;nbsp;m_sum”} ${m_sum}${/}&lt;/EM&gt; to&amp;nbsp;&lt;EM&gt;${MySurvey | stats: “sum, male_interact}&lt;/EM&gt;. Notice that the # pound sign has been removed to indicate there is only one value in the result.&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You can find examples in this help topic:&amp;nbsp;&lt;A href="https://docdev.arcgis.com/en/survey123/browser/analyze-results/featurereportqueries.htm" target="_blank"&gt;https://docdev.arcgis.com/en/survey123/browser/analyze-results/featurereportqueries.htm&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;Hence, you could try the following syntax to add the 3 numbers:&amp;nbsp;&lt;EM&gt;${(survey|stats:"sum, male_interact")+(survey|stats:"sum, female_interact")+(survey|stats:"sum, child_interact")} &lt;/EM&gt;(my survey layer name is `survey`).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Dec 2024 07:27:57 GMT</pubDate>
    <dc:creator>ZhifangWang</dc:creator>
    <dc:date>2024-12-09T07:27:57Z</dc:date>
    <item>
      <title>Sum multiple fields in Survey123 report</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/sum-multiple-fields-in-survey123-report/m-p/1555960#M59975</link>
      <description>&lt;P&gt;I'm trying to create a Survey123 report template that sums the values from three different number fields, but can't figure out how to do this. I can get the sum of each individual question, but not all three at once.&lt;/P&gt;&lt;P&gt;Each field asks the same question, but one for male, one for female and one for children. This code will give me the sum of all records for one field:&lt;/P&gt;&lt;P&gt;${#MySurvey | stats: “sum, male_interact, &amp;nbsp;m_sum”} ${m_sum}${/}&lt;/P&gt;&lt;P&gt;But what I want is more like:&lt;/P&gt;&lt;P&gt;${#MySurvey | stats: “sum, (male_interact, female_interact,&amp;nbsp;child_interact),&amp;nbsp; mfc_sum”} ${mfc_sum}${/}&lt;/P&gt;&lt;P&gt;Is there a way to do this in a report? Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 13:51:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/sum-multiple-fields-in-survey123-report/m-p/1555960#M59975</guid>
      <dc:creator>ZenMasterZeke</dc:creator>
      <dc:date>2024-11-08T13:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sum multiple fields in Survey123 report</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/sum-multiple-fields-in-survey123-report/m-p/1556352#M59993</link>
      <description>&lt;P&gt;I have a similar situation&lt;/P&gt;&lt;P&gt;I would like to have a report template that sums the values of three different numeric fields: num_plate1 + num_plate2 + num_plate3.&lt;/P&gt;&lt;P&gt;I have tried with this code but it does not work:&lt;/P&gt;&lt;P&gt;${Revisio_senyals_Bergueda | where: “(serie_placa1 = 'd39/2' OR serie_placa2 = 'd39/2' OR serie_placa3 = 'd39/2') AND (estat_placa1 = 'bon_estat' or estat_placa2 = 'bon_estat' or estat_placa3 = 'bon_estat')” | stats:"sum,(num_placa1 + num_placa2 + num_placa3)"}&lt;/P&gt;&lt;P&gt;Does anyone know how to get it?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2024 16:20:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/sum-multiple-fields-in-survey123-report/m-p/1556352#M59993</guid>
      <dc:creator>PalomaGómezGonzález</dc:creator>
      <dc:date>2024-11-07T16:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sum multiple fields in Survey123 report</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/sum-multiple-fields-in-survey123-report/m-p/1556779#M60007</link>
      <description>&lt;P&gt;FWIW:&amp;nbsp; I know I could do this with a field in the survey itself, but for now, working with the data I have&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 13:51:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/sum-multiple-fields-in-survey123-report/m-p/1556779#M60007</guid>
      <dc:creator>ZenMasterZeke</dc:creator>
      <dc:date>2024-11-08T13:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Sum multiple fields in Survey123 report</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/sum-multiple-fields-in-survey123-report/m-p/1558542#M60073</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/116479"&gt;@ZenMasterZeke&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Assuming there are 3 records in your layer:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;For&amp;nbsp;male_interact, the value of the 3 records are: 1,2,3&lt;/LI&gt;
&lt;LI&gt;For female_interact,&amp;nbsp;the value of the 3 records are: 4,5,6&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;For child_interact,&amp;nbsp;the value of the 3 records are: 7,8,9&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Can you please confirm the expected result is 1+2+3+...+7+8+9=45?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 11:16:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/sum-multiple-fields-in-survey123-report/m-p/1558542#M60073</guid>
      <dc:creator>ZhifangWang</dc:creator>
      <dc:date>2024-11-14T11:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sum multiple fields in Survey123 report</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/sum-multiple-fields-in-survey123-report/m-p/1558829#M60084</link>
      <description>&lt;P&gt;Thank you &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/109662"&gt;@ZhifangWang&lt;/a&gt;. Yes, that's what it should be. I just can't figure out how to get 6 + 15 + 24 = 45, the sum of each group sum, if that makes sense.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2024 19:36:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/sum-multiple-fields-in-survey123-report/m-p/1558829#M60084</guid>
      <dc:creator>ZenMasterZeke</dc:creator>
      <dc:date>2024-11-14T19:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Sum multiple fields in Survey123 report</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/sum-multiple-fields-in-survey123-report/m-p/1566130#M60403</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/116479"&gt;@ZenMasterZeke&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The `stats` syntax utilizes the &lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer/#:~:text=groupByFieldsForStatistics%3DSTATE_NAME%2C%20GENDER-,outStatistics,-The%20definitions%20for" target="_self"&gt;outStatistics parameter of the /query operation&lt;/A&gt;, and can only calculate statistics for one field. The # sign means there are multiple values here, and you can iterate each one in the report.&lt;/P&gt;
&lt;P&gt;In your case, since you can ensure there is only one number (not multiple values) in the stats result, so the syntax can be simplified from&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;${#MySurvey | stats: “sum, male_interact, &amp;nbsp;m_sum”} ${m_sum}${/}&lt;/EM&gt; to&amp;nbsp;&lt;EM&gt;${MySurvey | stats: “sum, male_interact}&lt;/EM&gt;. Notice that the # pound sign has been removed to indicate there is only one value in the result.&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You can find examples in this help topic:&amp;nbsp;&lt;A href="https://docdev.arcgis.com/en/survey123/browser/analyze-results/featurereportqueries.htm" target="_blank"&gt;https://docdev.arcgis.com/en/survey123/browser/analyze-results/featurereportqueries.htm&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;Hence, you could try the following syntax to add the 3 numbers:&amp;nbsp;&lt;EM&gt;${(survey|stats:"sum, male_interact")+(survey|stats:"sum, female_interact")+(survey|stats:"sum, child_interact")} &lt;/EM&gt;(my survey layer name is `survey`).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 07:27:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/sum-multiple-fields-in-survey123-report/m-p/1566130#M60403</guid>
      <dc:creator>ZhifangWang</dc:creator>
      <dc:date>2024-12-09T07:27:57Z</dc:date>
    </item>
  </channel>
</rss>

