<?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 How to create sequential numbers based on the count of values from another field? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-create-sequential-numbers-based-on-the/m-p/1284597#M68627</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I need some help with a python code to populate a field with sequential numbers based on the count of another field in attribute table with field calculator. Like in the image, 10 x hm correspond to 1 km, but when count of hm &amp;lt;10 i need to summarize the last km with the values from hm field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;ArcMap 10.8.1&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="hm_km.png" style="width: 504px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/69632iA210C266882B0B72/image-dimensions/504x730?v=v2" width="504" height="730" role="button" title="hm_km.png" alt="hm_km.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2023 06:32:35 GMT</pubDate>
    <dc:creator>EmiliaB</dc:creator>
    <dc:date>2023-05-02T06:32:35Z</dc:date>
    <item>
      <title>How to create sequential numbers based on the count of values from another field?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-create-sequential-numbers-based-on-the/m-p/1284597#M68627</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I need some help with a python code to populate a field with sequential numbers based on the count of another field in attribute table with field calculator. Like in the image, 10 x hm correspond to 1 km, but when count of hm &amp;lt;10 i need to summarize the last km with the values from hm field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;&lt;P&gt;ArcMap 10.8.1&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="hm_km.png" style="width: 504px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/69632iA210C266882B0B72/image-dimensions/504x730?v=v2" width="504" height="730" role="button" title="hm_km.png" alt="hm_km.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 06:32:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-create-sequential-numbers-based-on-the/m-p/1284597#M68627</guid>
      <dc:creator>EmiliaB</dc:creator>
      <dc:date>2023-05-02T06:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sequential numbers based on the count of values from another field?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-create-sequential-numbers-based-on-the/m-p/1284716#M68641</link>
      <description>&lt;P&gt;km =&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;get_km(!hm!)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code Block&lt;/P&gt;&lt;LI-CODE lang="python"&gt;count = len([row for row in arcpy.da.SearchCursor("CApa_hm_km", ["*"])])
last_full_km = int(count / 10)
current_km = 0

def get_km(hm):
    global last_full_km
    global current_km
    current_km += hm / 1000
    km = current_km + 1
    if current_km &amp;lt; last_full_km:
        km = int(km)
    return km&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 02 May 2023 14:24:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-create-sequential-numbers-based-on-the/m-p/1284716#M68641</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2023-05-02T14:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create sequential numbers based on the count of values from another field?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-to-create-sequential-numbers-based-on-the/m-p/1285058#M68703</link>
      <description>&lt;P&gt;Thank you very much! it works!&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2023 06:51:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-to-create-sequential-numbers-based-on-the/m-p/1285058#M68703</guid>
      <dc:creator>EmiliaB</dc:creator>
      <dc:date>2023-05-03T06:51:49Z</dc:date>
    </item>
  </channel>
</rss>

