<?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 THEN in MODEL BUILDER - If value in attribute &amp;gt; greater than - this do this, else do this - HELP!!!!!!!!!!!!!!!!!! in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564093#M44134</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that is a field calculator expression... are you trying to calculate something in a field? or did you just find this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jun 2016 21:59:24 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2016-06-09T21:59:24Z</dc:date>
    <item>
      <title>IF THEN in MODEL BUILDER - If value in attribute &gt; greater than - this do this, else do this - HELP!!!!!!!!!!!!!!!!!!</title>
      <link>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564089#M44130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is what I am trying to do -&lt;/P&gt;&lt;P&gt;I have a point feature class, in the feature class there is a field called&lt;BR /&gt;AdjRate. If the values in that field are &amp;gt; 0 then do one set of&lt;BR /&gt;geoprocessing, if the values are = 0 then use an alternate set of geoprocessing&lt;BR /&gt;functions.&amp;nbsp; I have found several example scripts with IF THEN STATEMENTS&lt;BR /&gt;for model builder, but nothing like this.&amp;nbsp; So far all I can find are examples&lt;BR /&gt;for checking if an extension exists etc... I know this must be super easy for&lt;BR /&gt;people who know python, but unfortunately I don't. I am trying to learn, but&lt;BR /&gt;need to figure this out before I have time. All you geniuses out there please&lt;BR /&gt;help! THANK YOU!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2016 17:52:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564089#M44130</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2016-06-09T17:52:02Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN in MODEL BUILDER - If value in attribute &gt; greater than - this do this, else do this - HELP!!!!!!!!!!!!!!!!!!</title>
      <link>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564090#M44131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so you saw this?&amp;nbsp; &lt;A href="http://desktop.arcgis.com/en/arcmap/latest/analyze/modelbuilder/using-if-then-else-logic-for-branching.htm" title="http://desktop.arcgis.com/en/arcmap/latest/analyze/modelbuilder/using-if-then-else-logic-for-branching.htm"&gt;Using If-Then-Else logic for branching—Help | ArcGIS for Desktop&lt;/A&gt; and the parts way down at the bottom of the page?&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.esri.com/esri/arcgis/2011/06/06/modelbuilderifthenelse1/" title="https://blogs.esri.com/esri/arcgis/2011/06/06/modelbuilderifthenelse1/"&gt;If you are stuck at "if" – Part 1 | ArcGIS Blog&lt;/A&gt;&amp;nbsp; and nothing helped?&amp;nbsp; perhaps, you need to provide your syntax for your query &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2016 17:55:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564090#M44131</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-06-09T17:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN in MODEL BUILDER - If value in attribute &gt; greater than - this do this, else do this - HELP!!!!!!!!!!!!!!!!!!</title>
      <link>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564091#M44132</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, First thank you for responding - and yes -I have read this - several time &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt; - I think that's where my limitations in python are really showing. I have downloaded the example tool boxes as well. I tried to understand and copy those pieces - but I think i am so limited that i am not even sure which arcpy function to call - here is an example of what I mean -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: none; font-size: 10pt;"&gt;def x(InputFeatureClass): import arcpy &lt;SPAN style="background: yellow;"&gt;desc = arcpy.Describe(InputFeatureClass)&lt;/SPAN&gt; &lt;SPAN style="background: yellow;"&gt;type = desc.shapeType&lt;/SPAN&gt; I&lt;/SPAN&gt; - where it reads arcpy.Describe(InputFeatureclass) type - I think I need a different function&amp;nbsp; here - but maybe I don't - I would post the code block, but I don't even have enough in it to post really &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;. That's how little&amp;nbsp; I know. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2016 18:23:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564091#M44132</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2016-06-09T18:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN in MODEL BUILDER - If value in attribute &gt; greater than - this do this, else do this - HELP!!!!!!!!!!!!!!!!!!</title>
      <link>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564092#M44133</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so here is what i have so far - and I havent a clue if this is even near correct&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;expression:&amp;nbsp; Rate(r"%AttributeToCheck%")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;code block:&lt;/P&gt;&lt;P&gt;def Rate(Attributetocheck): &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; desc = arcpy.Describe(AttributeToCheck)&amp;nbsp; - not sure what would go here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RateValue = desc.datatype&amp;nbsp; - I have no idea what would go hear either&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if Rate &amp;gt; 60000: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "true"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "false"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type: boolean&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2016 18:37:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564092#M44133</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2016-06-09T18:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN in MODEL BUILDER - If value in attribute &gt; greater than - this do this, else do this - HELP!!!!!!!!!!!!!!!!!!</title>
      <link>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564093#M44134</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that is a field calculator expression... are you trying to calculate something in a field? or did you just find this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2016 21:59:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564093#M44134</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-06-09T21:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN in MODEL BUILDER - If value in attribute &gt; greater than - this do this, else do this - HELP!!!!!!!!!!!!!!!!!!</title>
      <link>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564094#M44135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The field is already in the feature class - if the field is &amp;gt; 0 I want to process the data down path a, if the value is = 0 I want to process down path b - I did get a little bit further- &lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/207352_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But not sure where to go from here....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2016 22:11:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564094#M44135</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2016-06-09T22:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN in MODEL BUILDER - If value in attribute &gt; greater than - this do this, else do this - HELP!!!!!!!!!!!!!!!!!!</title>
      <link>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564095#M44136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you have 3 different spellings of AttributeToCheck&amp;nbsp; &lt;/P&gt;&lt;P&gt;also it will return No Tgt Rate if it is &amp;lt; 0 ... if that is ok&lt;/P&gt;&lt;P&gt;otherwise it is going to return a string "false" make sure it needs a string because a boolean is either False or True with capital letters and no quotes.&lt;/P&gt;&lt;P&gt;Beyond that , I am not sure what it does&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2016 22:18:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564095#M44136</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-06-09T22:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN in MODEL BUILDER - If value in attribute &gt; greater than - this do this, else do this - HELP!!!!!!!!!!!!!!!!!!</title>
      <link>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564096#M44137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the purpose of getting unique values?&amp;nbsp; Do you intend to do some kind of iteration?&amp;nbsp; What would you iterate?&amp;nbsp; Without iteration I do not think you need If Then logic at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For problems like this I normally start the script with the shape file, use the Make Feature Layer tool to convert it to a Layer, use the Select Layer By Attribute tool with a selection expression of "FIELD" &amp;gt; 0, do the processing on those records, then Select Layer By Attributes with a selection expression of "FIELD"&amp;nbsp; &amp;lt;=0 or "FIELD" IS NULL and do the other processing.&amp;nbsp; ("FIELD" is any actual field name of an existing numeric field).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="207502" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/207502_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jun 2016 01:12:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564096#M44137</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2016-06-12T01:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN in MODEL BUILDER - If value in attribute &gt; greater than - this do this, else do this - HELP!!!!!!!!!!!!!!!!!!</title>
      <link>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564097#M44138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This does give me some ideas on a different approach. Yes, I do need to iterate the files - there will be hundreds of files like this. I THINK i need to iterate anyway.&amp;nbsp; Essentially each file comes to me in the same format.&amp;nbsp; A shapefile with several attributes. The name of the shapefile is irrelevant.&amp;nbsp; There is a field in the shapefile that will have a an average of &amp;gt; 90 - these files will be soybean, then a second field (Tgt_Rate_s) is checked for average =&amp;lt;1. These will not get a QC check because they lack the necessary data to do so.&amp;nbsp; If this Tgt_Rate_s average is &amp;gt; 1 then the qc process will be run.&amp;nbsp; Once the QC process has run then IDW occurs.&amp;nbsp; This happens for every shapefile.&amp;nbsp; If its not soybean its then classified as corn and will have different processes that run.&amp;nbsp; I have 4 models that work right now.&amp;nbsp; For each of these. However right now, I have to check the fields, move each "type", corn vs soy then Tgt_rate_s (yes or now) - ending up with 4 folders. Then I use the appropriate model and iterate the shapefiles in the respective folder.&amp;nbsp; My goal was to combine the processes so that I could just choose the files to iterate and not worry about separating into 4 different folders first. Thanks so much for all of the suggestions and help.&amp;nbsp; My model that works is pasted below. There is a lot in the model around selecting a field boundary and setting as a mast as well. Thanks!&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="261" src="https://community.esri.com/legacyfs/online/207601_pastedImage_5.png" style="height: 261px; width: 1050.78px;" width="1051" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 15:01:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564097#M44138</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2016-06-13T15:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: IF THEN in MODEL BUILDER - If value in attribute &gt; greater than - this do this, else do this - HELP!!!!!!!!!!!!!!!!!!</title>
      <link>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564098#M44139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ModelBuilder is a waste of time frankly for what you want to do, since this type of general model requires real programming and not the pseudo-coding ModelBuilder offers.&amp;nbsp; Converting the process to Python is the best advice and you will get much more help on the Forum.&amp;nbsp; The learning curve may seem steep, but you won't get it done in ModelBuilder faster, since once you get to complexities like this ModelBuilder starts showing its many limitations and Python becomes much simpler to set up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Export the 4 separate working models into 4 seperate Python files using the modelBuilder export functions as a starting point.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't see how to connect your description of what you are doing to the model you have posted, since you are assuming I will understand field names and other information that only you currently know exist.&amp;nbsp; For example, what in the shapefile will have an average of &amp;gt;90?&amp;nbsp; A field?&amp;nbsp; A count of records?&amp;nbsp; The whole process can probably be restructured to be better organized to enhance the code's ability to handle the full range of your inputs once all of the essential components in play are actually laid out in an intelligible order to people like Dan and myself.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jun 2016 15:22:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/if-then-in-model-builder-if-value-in-attribute-gt/m-p/564098#M44139</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2016-06-13T15:22:11Z</dc:date>
    </item>
  </channel>
</rss>

