<?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 Multiple Totals In a single Attribute Table field in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/multiple-totals-in-a-single-attribute-table-field/m-p/1240144#M63293</link>
    <description>&lt;P&gt;So I have multiple rivers within the one shapefile, I want to get the length for each river, I have this script inserted into the field calculator but it outputs a total for all the rivers, I would like to stop with every new river and start a new total.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Expression: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;accumulate(!Shape_Length!) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Code Block:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;total = 0 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;def accumulate(increment): &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;global total &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if &lt;/SPAN&gt;&lt;SPAN&gt;total:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;total += increment&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;else: total = increment&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;return total&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a river ID to differentiate each river in the shapefile. This can be seen in the image as SegmentID&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Dec 2022 14:30:39 GMT</pubDate>
    <dc:creator>TimothyODoherty</dc:creator>
    <dc:date>2022-12-12T14:30:39Z</dc:date>
    <item>
      <title>Multiple Totals In a single Attribute Table field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/multiple-totals-in-a-single-attribute-table-field/m-p/1240144#M63293</link>
      <description>&lt;P&gt;So I have multiple rivers within the one shapefile, I want to get the length for each river, I have this script inserted into the field calculator but it outputs a total for all the rivers, I would like to stop with every new river and start a new total.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Expression: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;accumulate(!Shape_Length!) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Code Block:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;total = 0 &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;def accumulate(increment): &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;global total &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if &lt;/SPAN&gt;&lt;SPAN&gt;total:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;total += increment&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;else: total = increment&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;return total&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have a river ID to differentiate each river in the shapefile. This can be seen in the image as SegmentID&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 14:30:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/multiple-totals-in-a-single-attribute-table-field/m-p/1240144#M63293</guid>
      <dc:creator>TimothyODoherty</dc:creator>
      <dc:date>2022-12-12T14:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Totals In a single Attribute Table field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/multiple-totals-in-a-single-attribute-table-field/m-p/1240150#M63295</link>
      <description>&lt;P&gt;Use&lt;/P&gt;&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;&lt;/P&gt;&lt;P&gt;with your river name/id as the case field&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 14:37:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/multiple-totals-in-a-single-attribute-table-field/m-p/1240150#M63295</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2022-12-12T14:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Totals In a single Attribute Table field</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/multiple-totals-in-a-single-attribute-table-field/m-p/1240184#M63300</link>
      <description>&lt;P&gt;Agree with&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/215600"&gt;@DanPatterson&lt;/a&gt;&amp;nbsp;on using 'SUM' with&amp;nbsp;&lt;SPAN&gt;river ID as 'case_field'&lt;/SPAN&gt; &amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/analysis/summary-statistics.htm" target="_blank" rel="nofollow noopener noreferrer"&gt;Summary Statistics (Analysis)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Alternately, use 'groupby' river ID in your Python expression.&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Dec 2022 15:58:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/multiple-totals-in-a-single-attribute-table-field/m-p/1240184#M63300</guid>
      <dc:creator>AyanPalit</dc:creator>
      <dc:date>2022-12-12T15:58:39Z</dc:date>
    </item>
  </channel>
</rss>

