<?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: Label Expression in Addressing Questions</title>
    <link>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836940#M290</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You Ian for introducing Split concept, I was able to use this in the field calculator with python parser&lt;/P&gt;&lt;P&gt;!fieldname!.split(" ")[0]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Aug 2017 14:21:49 GMT</pubDate>
    <dc:creator>EmmanuelJohn1</dc:creator>
    <dc:date>2017-08-01T14:21:49Z</dc:date>
    <item>
      <title>Label Expression</title>
      <link>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836937#M287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; does anyone know of an expression that can help me make a label of everything before the first space within a field??&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Home numbers of an address field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Jul 2017 20:27:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836937#M287</guid>
      <dc:creator>EmmanuelJohn1</dc:creator>
      <dc:date>2017-07-31T20:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression</title>
      <link>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836938#M288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using Python Parser.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; FindLabel &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;fieldname&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;fieldname&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;" "&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;‍‍&lt;SPAN class="line-numbers-rows"&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm assuming that the field in question is a text field.&amp;nbsp; This splits a text string by a space character(.split(" ")&amp;nbsp;and returns the first portion of that string(actually splits the whole string into a list of strings and returns the first item of that list hence the [0])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:09:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836938#M288</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2021-12-12T10:09:59Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression</title>
      <link>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836939#M289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2017 14:18:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836939#M289</guid>
      <dc:creator>EmmanuelJohn1</dc:creator>
      <dc:date>2017-08-01T14:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression</title>
      <link>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836940#M290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You Ian for introducing Split concept, I was able to use this in the field calculator with python parser&lt;/P&gt;&lt;P&gt;!fieldname!.split(" ")[0]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2017 14:21:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836940#M290</guid>
      <dc:creator>EmmanuelJohn1</dc:creator>
      <dc:date>2017-08-01T14:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression</title>
      <link>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836941#M291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Emmanuel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please mark Ian's response as Correct to close out this thread.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Aug 2017 14:41:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836941#M291</guid>
      <dc:creator>AdrianWelsh</dc:creator>
      <dc:date>2017-08-01T14:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression</title>
      <link>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836942#M292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is not working for us in ArcGIS Pro. We are also trying to return everything before the first space (or drop everything after the first space). I attached a picture of what the Invalid Expression response was. Thank you in advance for saving&amp;nbsp;the day&amp;nbsp;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kathy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2018 17:01:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836942#M292</guid>
      <dc:creator>kathyhardinwalker</dc:creator>
      <dc:date>2018-05-16T17:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression</title>
      <link>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836943#M293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/49729"&gt;kathy walker&lt;/A&gt;‌:&amp;nbsp; You may need to put exclamations around the [ADDRESS] in line 1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/406749_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2018 17:08:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836943#M293</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2018-05-16T17:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression</title>
      <link>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836944#M294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Joe. We finally got something that works:&lt;/P&gt;&lt;P&gt;def FindLabel ( [Location] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if [Location] == None:&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "No Address"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = [Location]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x1 = x.split(" ")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return x1[0]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2018 20:12:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836944#M294</guid>
      <dc:creator>kathyhardinwalker</dc:creator>
      <dc:date>2018-05-16T20:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression</title>
      <link>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836945#M295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/49729"&gt;kathy walker&lt;/A&gt;&amp;nbsp;-&amp;nbsp; I just gave the original expression a go and it worked for me.&amp;nbsp; It appears that when using the python parsing tool ArcGIS Pro understands that exclamations are implied. (Like the use of quotes as well...) I thought your problem might have been None values, but my data has them too.&amp;nbsp; Not sure what's up there....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2018 21:24:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836945#M295</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2018-05-16T21:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: Label Expression</title>
      <link>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836946#M296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One problem we discovered, the field we were using was indexed, it had&amp;nbsp;an asterisk (Address*) in the header. As soon as we switched to a field that was not indexed we started getting somewhere.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2018 21:30:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/addressing-questions/label-expression/m-p/836946#M296</guid>
      <dc:creator>kathyhardinwalker</dc:creator>
      <dc:date>2018-05-16T21:30:25Z</dc:date>
    </item>
  </channel>
</rss>

