<?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 statement in Field Calculator in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666926#M22207</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been on a 2 hour search for the right code to do my basic If/Then Statement and yours was the only one that worked, thank you!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Sep 2018 22:03:57 GMT</pubDate>
    <dc:creator>JohannaValente</dc:creator>
    <dc:date>2018-09-18T22:03:57Z</dc:date>
    <item>
      <title>If statement in Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666921#M22202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am having problems with if statements in the Field calculator. This is my first time trying to code something in the field calculator. I am familiar with coding as I have used java and visual basic before. I created contours and I have a field that is set to 1 for all contours that are not an interval of 5 and set to 2 for all 5 foot contours. I have created another Field called Layer that I want to populate with a string for Minor and a different string for major contours. Can anyone help with this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 14:25:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666921#M22202</guid>
      <dc:creator>GregSullivan1</dc:creator>
      <dc:date>2013-05-07T14:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666922#M22203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Greg,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What constitutes the Layer field to have the Minor string, and Major string?&amp;nbsp; If the other field is 1, should the Layer field have a value of 'Minor'??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 16:38:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666922#M22203</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-05-07T16:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666923#M22204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes I am trying to set the Layer field to 'Minor' if the other field = 1 and set the layer field to 'Major' if the other field = 2&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 17:06:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666923#M22204</guid>
      <dc:creator>GregSullivan1</dc:creator>
      <dc:date>2013-05-07T17:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666924#M22205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can achieve this using python.&amp;nbsp; Here is an example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]24101[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 17:24:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666924#M22205</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2013-05-07T17:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666925#M22206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In VB Script you would do the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Parser: VB Script&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use Codeblock: checked&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Codeblock:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;If [Other_Field] = 1 Then
&amp;nbsp; Output = "Minor"
ElseIf [Other_Field] = 2 Then
&amp;nbsp; Output = "Major"
Else
&amp;nbsp; Output = [Layer] '&amp;nbsp; Use the existing value of the field being calculated so that it won't change.
End If&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;expression: Output&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 04:11:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666925#M22206</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2021-12-12T04:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666926#M22207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been on a 2 hour search for the right code to do my basic If/Then Statement and yours was the only one that worked, thank you!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Sep 2018 22:03:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666926#M22207</guid>
      <dc:creator>JohannaValente</dc:creator>
      <dc:date>2018-09-18T22:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: If statement in Field Calculator</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666927#M22208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Johanna:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am glad it helped.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Sep 2018 14:12:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/if-statement-in-field-calculator/m-p/666927#M22208</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2018-09-19T14:12:12Z</dc:date>
    </item>
  </channel>
</rss>

