<?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: Using Conditional Formatting to Populate a New Field Using Field Calculator. in ArcGIS Solutions Questions</title>
    <link>https://community.esri.com/t5/arcgis-solutions-questions/using-conditional-formatting-to-populate-a-new/m-p/381073#M429</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you only have one condition why not make it quick&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;make a text field if not already done&lt;/LI&gt;&lt;LI&gt;query your Days from Appt field for values &amp;lt; 7 assuming it is numeric (won't matter if it is text unless &amp;gt;= 10)&lt;/LI&gt;&lt;LI&gt;go to your new field and use the field calculator to past in "&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;One week or less"&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;switch the selection, type/select&amp;nbsp; str(&amp;nbsp; ) and select your source field&amp;nbsp; so it yields&amp;nbsp; str(!your really long field name above!) enclosed in ! marks if using Python...&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;or in totally untested code and assuming your source field is numeric&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;python parser&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def appt(input_field):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """no error checking"""
&amp;nbsp;&amp;nbsp;&amp;nbsp; if input_field &amp;lt; 7:&amp;nbsp; # assuming a numeric field otherwise int(input_field)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val = "One week or less"
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val = str(input_field)
&amp;nbsp;&amp;nbsp;&amp;nbsp; return val&lt;/PRE&gt;&lt;P&gt;field expression&amp;nbsp; !your_field_here!&lt;/P&gt;&lt;P&gt;obviously changing !your_field_here! to you know, your field&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 17:34:35 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2021-12-11T17:34:35Z</dc:date>
    <item>
      <title>Using Conditional Formatting to Populate a New Field Using Field Calculator.</title>
      <link>https://community.esri.com/t5/arcgis-solutions-questions/using-conditional-formatting-to-populate-a-new/m-p/381072#M428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use conditional statement to populate a new field using the Field Calculator.&amp;nbsp; I have a column named "Days from Appt."&amp;nbsp; I would like the field to populate if less than 7 days "One week or less."&amp;nbsp; I named this new column Duration.&amp;nbsp; Can someone please help a newbie to programming with this?&amp;nbsp; Can either&amp;nbsp; be in VB or Python. Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Sep 2015 00:04:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-solutions-questions/using-conditional-formatting-to-populate-a-new/m-p/381072#M428</guid>
      <dc:creator>BillFearrington</dc:creator>
      <dc:date>2015-09-26T00:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using Conditional Formatting to Populate a New Field Using Field Calculator.</title>
      <link>https://community.esri.com/t5/arcgis-solutions-questions/using-conditional-formatting-to-populate-a-new/m-p/381073#M429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since you only have one condition why not make it quick&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;make a text field if not already done&lt;/LI&gt;&lt;LI&gt;query your Days from Appt field for values &amp;lt; 7 assuming it is numeric (won't matter if it is text unless &amp;gt;= 10)&lt;/LI&gt;&lt;LI&gt;go to your new field and use the field calculator to past in "&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;One week or less"&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;switch the selection, type/select&amp;nbsp; str(&amp;nbsp; ) and select your source field&amp;nbsp; so it yields&amp;nbsp; str(!your really long field name above!) enclosed in ! marks if using Python...&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;or in totally untested code and assuming your source field is numeric&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;python parser&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def appt(input_field):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """no error checking"""
&amp;nbsp;&amp;nbsp;&amp;nbsp; if input_field &amp;lt; 7:&amp;nbsp; # assuming a numeric field otherwise int(input_field)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val = "One week or less"
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; val = str(input_field)
&amp;nbsp;&amp;nbsp;&amp;nbsp; return val&lt;/PRE&gt;&lt;P&gt;field expression&amp;nbsp; !your_field_here!&lt;/P&gt;&lt;P&gt;obviously changing !your_field_here! to you know, your field&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:34:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-solutions-questions/using-conditional-formatting-to-populate-a-new/m-p/381073#M429</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T17:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using Conditional Formatting to Populate a New Field Using Field Calculator.</title>
      <link>https://community.esri.com/t5/arcgis-solutions-questions/using-conditional-formatting-to-populate-a-new/m-p/381074#M430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your response.&amp;nbsp; I forgot to mention that I need to have several if statements.&amp;nbsp; I will have 8-14 days = Two weeks or less, 15-21 = Three weeks or less.&amp;nbsp; Also I have negative days which will be greater than one week, etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Sep 2015 01:58:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-solutions-questions/using-conditional-formatting-to-populate-a-new/m-p/381074#M430</guid>
      <dc:creator>BillFearrington</dc:creator>
      <dc:date>2015-09-26T01:58:35Z</dc:date>
    </item>
    <item>
      <title>Re: Using Conditional Formatting to Populate a New Field Using Field Calculator.</title>
      <link>https://community.esri.com/t5/arcgis-solutions-questions/using-conditional-formatting-to-populate-a-new/m-p/381075#M431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also I tried this before I left for the day.&amp;nbsp; I would put the code in the code block and what would I use&lt;/P&gt;&lt;P&gt;for the box under the code block?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Sep 2015 02:03:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-solutions-questions/using-conditional-formatting-to-populate-a-new/m-p/381075#M431</guid>
      <dc:creator>BillFearrington</dc:creator>
      <dc:date>2015-09-26T02:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Using Conditional Formatting to Populate a New Field Using Field Calculator.</title>
      <link>https://community.esri.com/t5/arcgis-solutions-questions/using-conditional-formatting-to-populate-a-new/m-p/381076#M432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the !your_field_here!&amp;nbsp; &lt;/P&gt;&lt;P&gt;for homework...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if a &amp;lt; 7:&lt;/P&gt;&lt;P&gt;&amp;nbsp; val = do blah&lt;/P&gt;&lt;P&gt;elif (a &amp;gt;= 7) and (a &amp;lt; 14):&lt;/P&gt;&lt;P&gt;&amp;nbsp; val = more blah&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;else:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; val = final blah&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;return val&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Sep 2015 02:09:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-solutions-questions/using-conditional-formatting-to-populate-a-new/m-p/381076#M432</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-09-26T02:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Using Conditional Formatting to Populate a New Field Using Field Calculator.</title>
      <link>https://community.esri.com/t5/arcgis-solutions-questions/using-conditional-formatting-to-populate-a-new/m-p/381077#M433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help.&amp;nbsp; I'll have to give it a try on Monday.&amp;nbsp; Wish Me Luck.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Sep 2015 02:17:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-solutions-questions/using-conditional-formatting-to-populate-a-new/m-p/381077#M433</guid>
      <dc:creator>BillFearrington</dc:creator>
      <dc:date>2015-09-26T02:17:51Z</dc:date>
    </item>
  </channel>
</rss>

