<?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: Using calculate field to sum values based on two columns, number and string in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-calculate-field-to-sum-values-based-on-two/m-p/1042634#M60607</link>
    <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/analysis/summary-statistics.htm" target="_blank"&gt;Summary Statistics (Analysis)—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;does it for you.&amp;nbsp; See the code sample to call it&lt;/P&gt;</description>
    <pubDate>Wed, 31 Mar 2021 21:40:07 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-03-31T21:40:07Z</dc:date>
    <item>
      <title>Using calculate field to sum values based on two columns, number and string</title>
      <link>https://community.esri.com/t5/python-questions/using-calculate-field-to-sum-values-based-on-two/m-p/1042633#M60606</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to use calculate field to add values to my column called Trail Length. I want to populate this column by adding together the trail sections that are part of the same trail.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Trail&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Section Length&amp;nbsp; &amp;nbsp; &amp;nbsp; Trail Length&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Trail A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(script that will add up the values in section length for Trail A, etc)&lt;/P&gt;&lt;P&gt;Trail A&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .2&lt;/P&gt;&lt;P&gt;Trail B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&lt;/P&gt;&lt;P&gt;Trail B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.3&lt;/P&gt;&lt;P&gt;Trail B&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 21:37:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-calculate-field-to-sum-values-based-on-two/m-p/1042633#M60606</guid>
      <dc:creator>MarilynLong1</dc:creator>
      <dc:date>2021-03-31T21:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using calculate field to sum values based on two columns, number and string</title>
      <link>https://community.esri.com/t5/python-questions/using-calculate-field-to-sum-values-based-on-two/m-p/1042634#M60607</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/analysis/summary-statistics.htm" target="_blank"&gt;Summary Statistics (Analysis)—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;does it for you.&amp;nbsp; See the code sample to call it&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 21:40:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-calculate-field-to-sum-values-based-on-two/m-p/1042634#M60607</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-31T21:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using calculate field to sum values based on two columns, number and string</title>
      <link>https://community.esri.com/t5/python-questions/using-calculate-field-to-sum-values-based-on-two/m-p/1115781#M62953</link>
      <description>&lt;P&gt;I've used summary stats to do this in the past but how do I incorporate that into the Field Calculator? I've been trying with Python and Arcade but don't know much about scripting and can't get it to work. This is what I have with Arcade:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;GroupBy($layer, 'name', { name: 'trail_ft', expression: 'sec_length_ft', statistic: 'SUM'})&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'name' is the column with the names of the trails. 'sec_length_ft' is the name of the column with the length of the sections that make up the trail. 'trail_ft' is the name of the column that I want to be updated.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 18:53:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-calculate-field-to-sum-values-based-on-two/m-p/1115781#M62953</guid>
      <dc:creator>MarilynLong1</dc:creator>
      <dc:date>2021-11-10T18:53:56Z</dc:date>
    </item>
  </channel>
</rss>

