<?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 Calculation with if clause dependent to other fields in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-with-if-clause-dependent-to-other/m-p/1202481#M58569</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need help with writing a function. I am trying to calculate the dollar per acre spending on&amp;nbsp;some products. The data behind is from USDA's Cropscape data. Count is how many pixels you have in a defined area (30m x 30m) which I converted to acres without any hustle.&lt;/P&gt;&lt;P&gt;Now I am trying to write this, with my limited vba knowledge, but don't know how to&lt;/P&gt;&lt;P&gt;DollarPerAcre=&lt;/P&gt;&lt;P&gt;IF CLASS_NAME = Alfalfa&lt;/P&gt;&lt;P&gt;THEN Acres * 100&lt;/P&gt;&lt;P&gt;ELSE IF CLASS_NAME = *Wheat* (contains "Wheat" in it)&lt;/P&gt;&lt;P&gt;THEN Acres * 80&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;I would appreciate any help&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="h_deniz_ozturk_0-1660325375628.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48542i56A099A3A927589D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="h_deniz_ozturk_0-1660325375628.png" alt="h_deniz_ozturk_0-1660325375628.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Aug 2022 17:36:11 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2022-08-12T17:36:11Z</dc:date>
    <item>
      <title>Calculation with if clause dependent to other fields</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-with-if-clause-dependent-to-other/m-p/1202481#M58569</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need help with writing a function. I am trying to calculate the dollar per acre spending on&amp;nbsp;some products. The data behind is from USDA's Cropscape data. Count is how many pixels you have in a defined area (30m x 30m) which I converted to acres without any hustle.&lt;/P&gt;&lt;P&gt;Now I am trying to write this, with my limited vba knowledge, but don't know how to&lt;/P&gt;&lt;P&gt;DollarPerAcre=&lt;/P&gt;&lt;P&gt;IF CLASS_NAME = Alfalfa&lt;/P&gt;&lt;P&gt;THEN Acres * 100&lt;/P&gt;&lt;P&gt;ELSE IF CLASS_NAME = *Wheat* (contains "Wheat" in it)&lt;/P&gt;&lt;P&gt;THEN Acres * 80&lt;/P&gt;&lt;P&gt;ELSE&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;I would appreciate any help&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="h_deniz_ozturk_0-1660325375628.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/48542i56A099A3A927589D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="h_deniz_ozturk_0-1660325375628.png" alt="h_deniz_ozturk_0-1660325375628.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 17:36:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-with-if-clause-dependent-to-other/m-p/1202481#M58569</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2022-08-12T17:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation with if clause dependent to other fields</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/calculation-with-if-clause-dependent-to-other/m-p/1202532#M58578</link>
      <description>&lt;P&gt;code block:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;def get_factor(class_name):
    if class_name == "Alfalfa":
        return 100
    if "Wheat" in class_name:
        return 80
    return 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;DollarPerAcre = get_factor(!CLASS_NAME!) * !Acres! &lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Aug 2022 19:24:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/calculation-with-if-clause-dependent-to-other/m-p/1202532#M58578</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-08-12T19:24:55Z</dc:date>
    </item>
  </channel>
</rss>

