<?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: If conditional Expression in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/if-conditional-expression/m-p/307972#M1971</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to store the value in a variable, and use that variable name as the expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;result‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Code block:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;If &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;GRIDCODE&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt; Then
result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Não há diferença"&lt;/SPAN&gt;
ELSEIF &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;GRIDCODE&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; Then
result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Área de uso consolidado cadastrada como nativa"&lt;/SPAN&gt;
ELSEIF &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;GRIDCODE&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt; Then
result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Área de vegetação nativa cadastrada como uso consolidado"&lt;/SPAN&gt;
End If‍‍‍‍‍‍‍&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Note: you should always return something with an ELSE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 14:44:21 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2021-12-11T14:44:21Z</dc:date>
    <item>
      <title>If conditional Expression</title>
      <link>https://community.esri.com/t5/developers-questions/if-conditional-expression/m-p/307971#M1970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to fill a field using an expression, but including a condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GRIDCODE&lt;/STRONG&gt; (field reference, unique values from 0 to 2"&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERRO&lt;/STRONG&gt; - blank field I would fill as follow:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If GRIDCODE value is 0, then ERRO value is:&amp;nbsp;&lt;SPAN&gt;"Não há diferença"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If GRIDCODE value is 1, then ERRO value is: &lt;SPAN&gt;"Área de uso consolidado cadastrada como nativa"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If GRIDCODE value is &lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;, then ERRO value is:&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;"Área de vegetação nativa cadastrada como uso consolidado"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried use this expression, but it doens´t work.. looks like it has a sintaxe error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If [GRIDCODE] = 0 Then&lt;BR /&gt; [Erro] = "Não há diferença"&lt;BR /&gt;ELSEIF [GRIDCODE] = 1 Then&lt;BR /&gt; [Erro] = "Área de uso consolidado cadastrada como nativa"&lt;BR /&gt;ELSEIF [GRIDCODE] = 2 Then&lt;BR /&gt; [Erro] = "Área de vegetação nativa cadastrada como uso consolidado"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2017 15:14:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/if-conditional-expression/m-p/307971#M1970</guid>
      <dc:creator>CarlosPires2</dc:creator>
      <dc:date>2017-03-20T15:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: If conditional Expression</title>
      <link>https://community.esri.com/t5/developers-questions/if-conditional-expression/m-p/307972#M1971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to store the value in a variable, and use that variable name as the expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expression:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;result‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Code block:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;If &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;GRIDCODE&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt; Then
result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Não há diferença"&lt;/SPAN&gt;
ELSEIF &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;GRIDCODE&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt; Then
result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Área de uso consolidado cadastrada como nativa"&lt;/SPAN&gt;
ELSEIF &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;GRIDCODE&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt; Then
result &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Área de vegetação nativa cadastrada como uso consolidado"&lt;/SPAN&gt;
End If‍‍‍‍‍‍‍&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Note: you should always return something with an ELSE.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:44:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/if-conditional-expression/m-p/307972#M1971</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T14:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: If conditional Expression</title>
      <link>https://community.esri.com/t5/developers-questions/if-conditional-expression/m-p/307973#M1972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In what way doesn't it "work"?&lt;/P&gt;&lt;P&gt;Arc version. Error message etc etc.&lt;/P&gt;&lt;P&gt;Is this something where you are trying to use the&amp;nbsp;field calculator?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2017 16:00:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/if-conditional-expression/m-p/307973#M1972</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2017-03-20T16:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: If conditional Expression</title>
      <link>https://community.esri.com/t5/developers-questions/if-conditional-expression/m-p/307974#M1973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Darren, was looking at something else, then you replied....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2017 16:01:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/if-conditional-expression/m-p/307974#M1973</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2017-03-20T16:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: If conditional Expression</title>
      <link>https://community.esri.com/t5/developers-questions/if-conditional-expression/m-p/307975#M1974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm agree with Daren. &amp;nbsp;You need to store the result in a variable.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim value&lt;BR /&gt;If [GRIDCODE] = 0 Then&lt;BR /&gt;value = "Não há diferença"&lt;BR /&gt;ELSEIF [GRIDCODE] = 1 Then&lt;BR /&gt;value = "Área de uso consolidado cadastrada como nativa"&lt;BR /&gt;ELSEIF [GRIDCODE] = 2 Then&lt;BR /&gt;value = "Área de vegetação nativa cadastrada como uso consolidado"&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And put into a calculator.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="343223" alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/343223_01.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2017 16:39:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/if-conditional-expression/m-p/307975#M1974</guid>
      <dc:creator>EdwinRoa</dc:creator>
      <dc:date>2017-03-20T16:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: If conditional Expression</title>
      <link>https://community.esri.com/t5/developers-questions/if-conditional-expression/m-p/307976#M1975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Neil,&lt;/P&gt;&lt;P&gt;version 10.2&lt;/P&gt;&lt;P&gt;sintaxe error&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Mar 2017 17:03:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/if-conditional-expression/m-p/307976#M1975</guid>
      <dc:creator>CarlosPires2</dc:creator>
      <dc:date>2017-03-20T17:03:48Z</dc:date>
    </item>
  </channel>
</rss>

