<?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 Multiple Fields but Omit Null/Specific Value in Map Advice Community Questions</title>
    <link>https://community.esri.com/t5/map-advice-community-questions/label-multiple-fields-but-omit-null-specific-value/m-p/850213#M196</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All of your comments were extremely helpful, thank you!!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Mar 2020 17:28:40 GMT</pubDate>
    <dc:creator>BenjaminSmith_McRobie2</dc:creator>
    <dc:date>2020-03-23T17:28:40Z</dc:date>
    <item>
      <title>Label Multiple Fields but Omit Null/Specific Value</title>
      <link>https://community.esri.com/t5/map-advice-community-questions/label-multiple-fields-but-omit-null-specific-value/m-p/850210#M193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am setting up manhole points with multiple labels (Manhole Number, Rim Elev, Inverts, etc.). I want to know if there is any possible way to write an expression that will omit/remove Null or specific values (such as "0"). I have screenshots below and a copy of my expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;[ "MH#: " &amp;amp; [MH_ID] &amp;amp; vbNewLine &amp;amp; "RIM: " &amp;amp; [RIM_ELEV] &amp;amp; vbNewLine &amp;amp; "INV 1: " &amp;amp; [INV_1] &amp;amp; vbNewLine &amp;amp; "INV 2: " &amp;amp; [INV_2] &amp;amp; vbNewLine &amp;amp; "INV 3: " &amp;amp; [INV_3] &amp;amp; vbNewLine &amp;amp; "INV 4: " &amp;amp; [INV_4] ]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 13:07:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/map-advice-community-questions/label-multiple-fields-but-omit-null-specific-value/m-p/850210#M193</guid>
      <dc:creator>BenjaminSmith_McRobie2</dc:creator>
      <dc:date>2020-03-23T13:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Label Multiple Fields but Omit Null/Specific Value</title>
      <link>https://community.esri.com/t5/map-advice-community-questions/label-multiple-fields-but-omit-null-specific-value/m-p/850211#M194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Benjamin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can provide you an example of this using Python:&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;NAME&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;FCC&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;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;FCC&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'0'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;or&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;FCC&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;NAME&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;NAME&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'\n'&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;FCC&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;/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;&lt;/P&gt;&lt;P&gt;The statement is saying if the value of field FCC equals 0 or NULL, return only the value of field NAME.&amp;nbsp; Else, return NAME and the FCC field values.&amp;nbsp; Here is an example using Pro:&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/485950_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:27:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/map-advice-community-questions/label-multiple-fields-but-omit-null-specific-value/m-p/850211#M194</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-12T10:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Label Multiple Fields but Omit Null/Specific Value</title>
      <link>https://community.esri.com/t5/map-advice-community-questions/label-multiple-fields-but-omit-null-specific-value/m-p/850212#M195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Hi,&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;I'm not familiar with VBScript, but this can be done relatively easily in Python, as long as you check the "Advanced" box in the Label expression window.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Example code:&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;def FindLabel ( [test], [test2] , [test4], [test3] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&amp;nbsp; test1, test2, test3, test4 = [test], [test2] , [test4], [test3] # assign variables for each of the input fields&lt;BR /&gt;&amp;nbsp; returnstring = "" #empty string for label&lt;BR /&gt;&amp;nbsp; for field in [test1, test2, test3, test4]: # looping through all input fields&lt;BR /&gt;&amp;nbsp; &amp;nbsp; if field is not None and field !="0": # checks field for your conditions, e.g. not null and not "0"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; returnstring += field + '\n' #adds field values to return string if above condition met&lt;BR /&gt;&amp;nbsp; return returnstring # returns label string&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Writing it this way will work for any number of fields you have, assuming the logic is the same for each (excluding null values and "0"'s.&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 14:10:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/map-advice-community-questions/label-multiple-fields-but-omit-null-specific-value/m-p/850212#M195</guid>
      <dc:creator>JoshuaSharp-Heward</dc:creator>
      <dc:date>2020-03-23T14:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: Label Multiple Fields but Omit Null/Specific Value</title>
      <link>https://community.esri.com/t5/map-advice-community-questions/label-multiple-fields-but-omit-null-specific-value/m-p/850213#M196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All of your comments were extremely helpful, thank you!!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 17:28:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/map-advice-community-questions/label-multiple-fields-but-omit-null-specific-value/m-p/850213#M196</guid>
      <dc:creator>BenjaminSmith_McRobie2</dc:creator>
      <dc:date>2020-03-23T17:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Label Multiple Fields but Omit Null/Specific Value</title>
      <link>https://community.esri.com/t5/map-advice-community-questions/label-multiple-fields-but-omit-null-specific-value/m-p/850214#M197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Benjamin,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Going through the labeling expression to do this will slow the labeling down, as each time it goes to label it runs the expression.&amp;nbsp; The preferred way will be to narrow down what is labeled using a SQL query.&lt;/P&gt;&lt;P&gt;You can see in the screenshot below an example where there is a feature with a MyNumber value of 0 and one with a NULL value.&amp;nbsp; The SQL query removes those and only the remaining features are labeled with the objectid field.&lt;/P&gt;&lt;P&gt;If you are not familiar with writing SQL queries please click the Help button on the dialog box and it will take you to the documentation - there are many examples included that will help you out with different scenarios.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/485999_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 18:11:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/map-advice-community-questions/label-multiple-fields-but-omit-null-specific-value/m-p/850214#M197</guid>
      <dc:creator>WendyHarrison</dc:creator>
      <dc:date>2020-03-23T18:11:29Z</dc:date>
    </item>
  </channel>
</rss>

