<?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: How can I field calculate sequential numbering which restart with each new day? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/how-can-i-field-calculate-sequential-numbering/m-p/342285#M15065</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Are you looking for an automated solution to&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;correct a few months of sequence data?&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;I've done that sort of things with an update cursor:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fc = r'C:\some\path\to\your\data'
startValue = 1
fields = ['YourFieldName']
where = "A a sql select statement for a particular date'

arcpy.MakeFeatureLayer_management(fc,'fcLayer')

arcpy.SelectLayerByAttribute_management('fcLayer', 'NEW_SELECTION', where)

with arcpy.da.UpdateCursor('fcLayer',fields)as cursor:
    for row in cursor:
        row[0] = startValue
        cursor.updateRow(row)
        startValue += 1
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you have a list of dates, you could loop through it and create the where statement on the fly. I &lt;EM&gt;think&amp;nbsp;&lt;/EM&gt;the update cursor will update in order of object id for the selected set, but don't quote me on that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***Untested for this particular application...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 16:08:53 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2021-12-11T16:08:53Z</dc:date>
    <item>
      <title>How can I field calculate sequential numbering which restart with each new day?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-can-i-field-calculate-sequential-numbering/m-p/342282#M15062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my feature table I have a column labeled 'Sequence' which I would like to add sequential numbering to which resets with each new day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Date&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Sequence&lt;/P&gt;&lt;P&gt;8/3/2020&amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;8/3/2020&amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;8/3/2020&amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;8/3/2020&amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;8/4/2020&amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;8/4/2020&amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2020 16:20:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-can-i-field-calculate-sequential-numbering/m-p/342282#M15062</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-08-04T16:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can I field calculate sequential numbering which restart with each new day?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-can-i-field-calculate-sequential-numbering/m-p/342283#M15063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What product are you using?&amp;nbsp; "Traditional Desktop (10.x)" or ArcGIS Pro?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the latter, you could write a script that deletes and then re-creates a database sequence, and run it every night at 00:00:01 hours as a scheduled task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/create-database-sequence.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/create-database-sequence.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Create Database Sequence (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/delete-database-sequence.htm" title="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/delete-database-sequence.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Delete Database Sequence (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/data-access/listdatabasesequences.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/data-access/listdatabasesequences.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;ListDatabaseSequences—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;(only available for file geodatabases: vote here to have it ported to enterprise geodatabases...&amp;nbsp;&lt;A href="https://community.esri.com/ideas/18798" target="_blank"&gt;https://community.esri.com/ideas/18798&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jun 2021 08:30:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-can-i-field-calculate-sequential-numbering/m-p/342283#M15063</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-06-22T08:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: How can I field calculate sequential numbering which restart with each new day?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-can-i-field-calculate-sequential-numbering/m-p/342284#M15064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is in ArcPro. I currently have script that runs this each night for the current day but recently it had a hiccup so I'm having to go back and correct a few months of sequence data.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2020 16:31:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-can-i-field-calculate-sequential-numbering/m-p/342284#M15064</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-08-04T16:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I field calculate sequential numbering which restart with each new day?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/how-can-i-field-calculate-sequential-numbering/m-p/342285#M15065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Are you looking for an automated solution to&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;correct a few months of sequence data?&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;I've done that sort of things with an update cursor:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;fc = r'C:\some\path\to\your\data'
startValue = 1
fields = ['YourFieldName']
where = "A a sql select statement for a particular date'

arcpy.MakeFeatureLayer_management(fc,'fcLayer')

arcpy.SelectLayerByAttribute_management('fcLayer', 'NEW_SELECTION', where)

with arcpy.da.UpdateCursor('fcLayer',fields)as cursor:
    for row in cursor:
        row[0] = startValue
        cursor.updateRow(row)
        startValue += 1
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If you have a list of dates, you could loop through it and create the where statement on the fly. I &lt;EM&gt;think&amp;nbsp;&lt;/EM&gt;the update cursor will update in order of object id for the selected set, but don't quote me on that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;***Untested for this particular application...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:08:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/how-can-i-field-calculate-sequential-numbering/m-p/342285#M15065</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T16:08:53Z</dc:date>
    </item>
  </channel>
</rss>

