<?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: Field Calculator in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324489#M18546</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much Ted! It worked. I assigned empty value for all non-numeric values and then excluded them by querying FC to FC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 May 2016 18:53:01 GMT</pubDate>
    <dc:creator>LianaSmith</dc:creator>
    <dc:date>2016-05-18T18:53:01Z</dc:date>
    <item>
      <title>Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324483#M18540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to exclude all values that contain any letter from one of the fields. Basically only integers should be left. What code (Python/VB) do I have to put in field calculator for that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 13:09:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324483#M18540</guid>
      <dc:creator>LianaSmith</dc:creator>
      <dc:date>2016-05-18T13:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324484#M18541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I covered that here &lt;A href="https://community.esri.com/thread/177150"&gt;Query to have only numeric values in the field &lt;/A&gt;&lt;/P&gt;&lt;P&gt;Add a numeric field (integer)&lt;/P&gt;&lt;P&gt;Use the python parser and use the syntax given&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14635773999345900" data-renderedposition="86_8_1171_16" jivemacro_uid="_14635773999345900" modifiedtitle="true"&gt;&lt;P&gt;int("".join([i &lt;SPAN class="keyword"&gt;for&lt;/SPAN&gt; i &lt;SPAN class="keyword"&gt;in&lt;/SPAN&gt; !YourFieldName! &lt;SPAN class="keyword"&gt;if&lt;/SPAN&gt; i.isdigit()]) )&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 13:14:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324484#M18541</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-18T13:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324485#M18542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dan, it does not work. That's what I get:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/201255_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/201256_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 13:31:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324485#M18542</guid>
      <dc:creator>LianaSmith</dc:creator>
      <dc:date>2016-05-18T13:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324486#M18543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ohhhh... You failed to mention that some of the entries don't have numbers in them. &lt;/P&gt;&lt;P&gt;So... you have to create a text/string field instead and delete the int( ) part.&amp;nbsp; Now of course, if there is no numbers in the entry, you will get back an empty string.&lt;/P&gt;&lt;P&gt;The question remains&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;do you want the output to only be numbers?&lt;/LI&gt;&lt;LI&gt;what do you want to do if there are no numbers in the entry?&lt;/LI&gt;&lt;LI&gt;are you good with a text representation of a number? or does it have to be a number?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The rule set will determine the format of the new field, the values it returns and the outputs it will return... especially if you want this as an automagic all encompassing solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 14:31:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324486#M18543</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-18T14:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324487#M18544</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for not mentioning them...I think I can not use field calculator at all.. I dont want to change the values that have letters, I need them to be deleted...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 14:38:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324487#M18544</guid>
      <dc:creator>LianaSmith</dc:creator>
      <dc:date>2016-05-18T14:38:23Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324488#M18545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to simply blank out any entry in which GROUTE contains a letter then perhaps you could do this (test on a copy first!):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since GROUTE could contain letters then it cannot be a number....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GROUTE = "" if any(b.isalpha() for b in !GROUTE!) else !GROUTE!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 15:55:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324488#M18545</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2016-05-18T15:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324489#M18546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much Ted! It worked. I assigned empty value for all non-numeric values and then excluded them by querying FC to FC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 18:53:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324489#M18546</guid>
      <dc:creator>LianaSmith</dc:creator>
      <dc:date>2016-05-18T18:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324490#M18547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ted, I exported the field calculator function to Python script and I get error now..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any idea why? Thanks again&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Error ocurred in:&lt;BR /&gt;&amp;nbsp; File "P:\Batch\J420992\CODE\PYTHON\J420992_C1_Customers.py", line 66, in &amp;lt;module&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management(WCSCUSTOMERCOPY, "GROUTE", " \"\" if any(b.isalpha() for b in !GROUTE!) else !GROUTE!", "PYTHON_9.3", "")&lt;/P&gt;&lt;P&gt;&amp;gt; Error Class is:&lt;BR /&gt;&amp;lt;class 'arcgisscripting.ExecuteError'&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Available error details are:&lt;BR /&gt;ERROR 000539: IndentationError: unexpected indent (&amp;lt;expression&amp;gt;, line 1)&lt;BR /&gt;Failed to execute (CalculateField).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 19:47:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324490#M18547</guid>
      <dc:creator>LianaSmith</dc:creator>
      <dc:date>2016-05-18T19:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324491#M18548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I new all this sounded familiar!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/thread/175976"&gt;How to remove spaces with Calculate field in ArcMap?&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 22:00:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324491#M18548</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-18T22:00:22Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324492#M18549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have an extra space:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'andale mono', times;"&gt;" \"\" if any(b.isalpha() for b in !GROUTE!) else !GROUTE!"&lt;/SPAN&gt;
&lt;SPAN style="color: #3d3d3d; font-family: 'andale mono', times;"&gt; ^&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use single quotes to wrap double quotes; easier to read:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'andale mono', times;"&gt;'"" if any(b.isalpha() for b in !GROUTE!) else !GROUTE!'&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:23:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324492#M18549</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-11T15:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324493#M18550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I removed space and got this error...&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="201413" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/201413_pastedImage_1.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I tried to use single quotes like you wrote and got this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/201414_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 13:14:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324493#M18550</guid>
      <dc:creator>LianaSmith</dc:creator>
      <dc:date>2016-05-19T13:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324494#M18551</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following works as a field calculator expression in Pro and also in ArcMap.&amp;nbsp; Check the details&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Field_calc01.png" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/201354_Field_calc01.png" style="width: 620px; height: 651px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 14:10:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324494#M18551</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-19T14:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324495#M18552</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 14:12:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324495#M18552</guid>
      <dc:creator>LianaSmith</dc:creator>
      <dc:date>2016-05-19T14:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324496#M18553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;LOL&amp;nbsp; I just got back to the office....&amp;nbsp; I only jumped in because it sounded like she only wanted to ignore those rows that had a character in it...&amp;nbsp;&amp;nbsp; When using python, now, I avoid nulls and put an empty/blank/unused code&amp;nbsp; filter and delete in a two step process since I do not trust finding nulls yet in python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Liana&amp;nbsp; I am happy you got it worked out!&amp;nbsp; That's all the matters!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 16:07:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324496#M18553</guid>
      <dc:creator>TedKowal</dc:creator>
      <dc:date>2016-05-19T16:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: Field Calculator</title>
      <link>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324497#M18554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Liana,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using Python, the Codeblock (Pre-logic Script Code) would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def result(value):
&amp;nbsp;&amp;nbsp;&amp;nbsp; import re
&amp;nbsp;&amp;nbsp;&amp;nbsp; return ""&amp;nbsp; if re.search("[a-zA-Z]", value) else value&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the calculation would be:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;result( !&amp;lt;FIELD_NAME&amp;gt;! )&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Be careful overwriting the same field.&amp;nbsp; You can't undo it unless you start an edit session first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Larry&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:23:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/field-calculator/m-p/324497#M18554</guid>
      <dc:creator>LarryStout</dc:creator>
      <dc:date>2021-12-11T15:23:48Z</dc:date>
    </item>
  </channel>
</rss>

