<?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 - VB - Conditional If,elseif statement... not working?! in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540085#M17984</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;"EndIf" needs a space ---------&amp;gt; "end if"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, IsNull is a function, and requires ()'s around the field name.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 May 2012 15:57:27 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2012-05-04T15:57:27Z</dc:date>
    <item>
      <title>Calculate Field - VB - Conditional If,elseif statement... not working?!</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540080#M17979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wihtin model builder I have used the field calculator, to try and populate a new empty field (called Water_Classification) based on the contents of another field. However, my VB statement is not working and I am unable to figure out why? If anybody can help, it would be much appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to put numeric values in a field called [Water_Classification] depending on what the string values are from another field called [CLASSIFICATION_1]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what I currently have:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If [CLASSIFICATION_1] = "High" then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; x =5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ElseIf [CLASSIFICATION_1] = "Medium" then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; x =3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ElseIf [CLASSIFICATION_1] = "Low" then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; x =1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ElseIf [CLASSIFICATION_1] = "&amp;lt;null&amp;gt;" then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; x =0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; x = 9999&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EndIf&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At the end (in the box at the bottom), I have: Water_Classification = x&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If anybody has any advice or tips, pelase let me know,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 14:37:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540080#M17979</guid>
      <dc:creator>HaileyMonod</dc:creator>
      <dc:date>2012-05-04T14:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field - VB - Conditional If,elseif statement... not working?!</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540081#M17980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think you need to add at the top of your code a simple dim statement like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;x&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Also not sure this line is correct:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ElseIf [CLASSIFICATION_1] = "&amp;lt;null&amp;gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you may want to try something like (I did not test these):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ElseIf [CLASSIFICATION_1] = ""&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ElseIf IsNull([CLASSIFICATION_1]) = True&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 14:41:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540081#M17980</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2012-05-04T14:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field - VB - Conditional If,elseif statement... not working?!</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540082#M17981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hhmm I have added Dim x at the top and changed that one line to be ElseIf IsNull([CLASSIFICATION_1]) = True then.... However its still not working. But I am getting a new error, which says "Error Executing Funtion. Expected 'Then' Failed to execute".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the help! any other ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 15:06:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540082#M17981</guid>
      <dc:creator>HaileyMonod</dc:creator>
      <dc:date>2012-05-04T15:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field - VB - Conditional If,elseif statement... not working?!</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540083#M17982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you post up the script, exactly how you entered it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 15:45:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540083#M17982</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2012-05-04T15:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field - VB - Conditional If,elseif statement... not working?!</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540084#M17983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dim x&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If [CLASSIFICATION_1] = "High" then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; x =5&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ElseIf [CLASSIFICATION_1] = "Medium" then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; x =3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ElseIf [CLASSIFICATION_1] = "Low" then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; x =1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ElseIf IsNull [CLASSIFICATION_1] = True then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; x=0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; x = 9999&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EndIf&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Water_Classification= x &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]14100[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]14101[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 15:55:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540084#M17983</guid>
      <dc:creator>HaileyMonod</dc:creator>
      <dc:date>2012-05-04T15:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field - VB - Conditional If,elseif statement... not working?!</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540085#M17984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;"EndIf" needs a space ---------&amp;gt; "end if"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, IsNull is a function, and requires ()'s around the field name.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 15:57:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540085#M17984</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2012-05-04T15:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field - VB - Conditional If,elseif statement... not working?!</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540086#M17985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is going to be painful...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EndIf&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;should be (note space)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Duncan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 15:58:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540086#M17985</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2012-05-04T15:58:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate Field - VB - Conditional If,elseif statement... not working?!</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540087#M17986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You guys are BRILLIANT !! &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Both the space was required and the ()'s after IsNull. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you so much!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hailey&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2012 16:03:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/calculate-field-vb-conditional-if-elseif-statement/m-p/540087#M17986</guid>
      <dc:creator>HaileyMonod</dc:creator>
      <dc:date>2012-05-04T16:03:43Z</dc:date>
    </item>
  </channel>
</rss>

