<?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: Calculate field questions in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/calculate-field-questions/m-p/335360#M19061</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Codeblock (Python):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;dict = {}
def myFunc(myClass):
&amp;nbsp; global dict
&amp;nbsp; dict[myClass] = dict.get(myClass, 0) + 1
&amp;nbsp; return myClass + "-" + str(dict[myClass])&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression (change to your field name):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;myFunc( !ST_NAME! )&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="191464" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/191464_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 15:53:32 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2021-12-11T15:53:32Z</dc:date>
    <item>
      <title>Calculate field questions</title>
      <link>https://community.esri.com/t5/data-management-questions/calculate-field-questions/m-p/335357#M19058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a field with street names, there are duplicate names in this collum. I want to add a number to the end of the name with a dash and have the multiple names count up incrementally (i.e MAIN ST-01, MAIN ST-02, MAIN ST-03, B ST-01)&lt;/P&gt;&lt;P&gt;there are several segments that have the same street name and would like to have a incremental number associated with it and then start back to -01 for a different street name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what do i need to do in the field calculator to accomplish this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2016 16:17:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/calculate-field-questions/m-p/335357#M19058</guid>
      <dc:creator>BrettGonslaves</dc:creator>
      <dc:date>2016-03-18T16:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field questions</title>
      <link>https://community.esri.com/t5/data-management-questions/calculate-field-questions/m-p/335358#M19059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See this thread for how you can create a dictionary to work with incremental numbers by class, in the field calculator: &lt;A _jive_internal="true" href="https://community.esri.com/thread/174051#comment-595324" title="https://community.esri.com/message/595324#comment-595324"&gt;https://community.esri.com/message/595324#comment-595324&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In that case, the dictionary would look like {1:x, 2:y, 3:z, ...} ...where x,y,z are incrementing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case, the dictionary would look like {'MAIN ST-':x, 'B ST-: y, ...} where x,y are incrementing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2016 16:24:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/calculate-field-questions/m-p/335358#M19059</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-03-18T16:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field questions</title>
      <link>https://community.esri.com/t5/data-management-questions/calculate-field-questions/m-p/335359#M19060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Being new to coding, what would the VB script or Pything script look like to accomplish this task?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Mar 2016 16:33:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/calculate-field-questions/m-p/335359#M19060</guid>
      <dc:creator>BrettGonslaves</dc:creator>
      <dc:date>2016-03-18T16:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate field questions</title>
      <link>https://community.esri.com/t5/data-management-questions/calculate-field-questions/m-p/335360#M19061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Codeblock (Python):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;dict = {}
def myFunc(myClass):
&amp;nbsp; global dict
&amp;nbsp; dict[myClass] = dict.get(myClass, 0) + 1
&amp;nbsp; return myClass + "-" + str(dict[myClass])&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression (change to your field name):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;myFunc( !ST_NAME! )&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="191464" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/191464_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:53:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/calculate-field-questions/m-p/335360#M19061</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T15:53:32Z</dc:date>
    </item>
  </channel>
</rss>

