<?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: Increment fields with null values in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/increment-fields-with-null-values/m-p/623#M22</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I glossed over that little aspect. thanks for the help. I hate over thinking/looking simple things.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Aug 2016 16:02:49 GMT</pubDate>
    <dc:creator>steveubert</dc:creator>
    <dc:date>2016-08-02T16:02:49Z</dc:date>
    <item>
      <title>Increment fields with null values</title>
      <link>https://community.esri.com/t5/data-management-questions/increment-fields-with-null-values/m-p/621#M20</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question about using python to auto increment numbers. I have a dataset with a range of numbers already defined (ID : 396548 - 410342) and (ID2 : 392988 - 406624). When I merged data I had fields that carried over 'Null' values. I do not want to change the known numbers, just the null values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a sample of my table, I have 27k fields with 13k numbered and the rest 'null'&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="233" style="border: 1px solid #c6c6c6; width: 91px; height: 218px;" width="121"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: left; background-color: #f2f2f2; color: #505050; padding: 6px;" valign="middle"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: left; background-color: #f2f2f2; color: #505050; padding: 6px;" valign="middle"&gt;&lt;STRONG&gt;ID2&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 6px;"&gt;null&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 6px;"&gt;null&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;null&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 6px;"&gt;396548&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;392988&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 6px;"&gt;410342&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;406642&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 6px;"&gt;&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I'm using&lt;/P&gt;&lt;P&gt;rec=0 &lt;/P&gt;&lt;P&gt;def autoIncrement(): &lt;/P&gt;&lt;P&gt; global rec &lt;/P&gt;&lt;P&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt;pStart = 1&amp;nbsp; &lt;BR /&gt; pInterval = 1 &lt;/CODE&gt;&lt;/P&gt;&lt;P&gt; if (rec == 0):&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; rec = pStart&amp;nbsp; &lt;/P&gt;&lt;P&gt; else:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; rec += pInterval&amp;nbsp; &lt;/P&gt;&lt;P&gt; return rec&lt;/P&gt;&lt;P&gt;ID =&lt;/P&gt;&lt;P&gt;autoIncrement()&lt;/P&gt;&lt;P&gt;I've tried chaging 'rec' to the starting number (ID:396548), but it changes all numbers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I using the right option or is there a better one out there&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 15:47:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/increment-fields-with-null-values/m-p/621#M20</guid>
      <dc:creator>steveubert</dc:creator>
      <dc:date>2016-08-02T15:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Increment fields with null values</title>
      <link>https://community.esri.com/t5/data-management-questions/increment-fields-with-null-values/m-p/622#M21</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;field calculations apply to all OR just a selection in the table... did you try selecting the records/rows that you want to change, then do the field calculation?&amp;nbsp; You are also going to have to change 'rec' to be the first number that you want changed, otherwise, it will increment from 0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 15:52:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/increment-fields-with-null-values/m-p/622#M21</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-08-02T15:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Increment fields with null values</title>
      <link>https://community.esri.com/t5/data-management-questions/increment-fields-with-null-values/m-p/623#M22</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I glossed over that little aspect. thanks for the help. I hate over thinking/looking simple things.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Aug 2016 16:02:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/increment-fields-with-null-values/m-p/623#M22</guid>
      <dc:creator>steveubert</dc:creator>
      <dc:date>2016-08-02T16:02:49Z</dc:date>
    </item>
  </channel>
</rss>

