<?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: How to calculate a field based on multiple conditions? in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-a-field-based-on-multiple/m-p/875457#M29123</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I first asked as a comment, and then thought it'd be better just to make my own post. I am trying your solution this morning, but also got a comment regarding "nested" if statements, so I'm going to try that too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Apr 2019 13:26:55 GMT</pubDate>
    <dc:creator>MichaelFazio2</dc:creator>
    <dc:date>2019-04-03T13:26:55Z</dc:date>
    <item>
      <title>How to calculate a field based on multiple conditions?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-a-field-based-on-multiple/m-p/875454#M29120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am creating a survey that is going to be used to collect water quality. The end user has specific criteria that they would like to use in symbolizing the data. The specific criteria are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="440950" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/440950_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, if the answers to 3 questions&amp;nbsp; meet one of those criteria, I want to calculate a separate field to auto-fill the appropriate Description, and use that to symbolize the data. Currently I have this in the calculation field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if((${P}&amp;lt;15,and ${TN}&amp;lt;400,and${ChloroA}&amp;lt;3),"Oligotrophic"), +&amp;nbsp; if((${P}&amp;gt;15 and &amp;lt;=25, and${TN}&amp;gt;400 and &amp;lt;=600,and${ChloroA}&amp;gt;3 and &amp;lt;=600),"Mesotrophic") + if((${P}&amp;gt;25,and ${TN}&amp;gt;=600,and${ChloroA}&amp;gt;=7),"Eutrophic")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've only recently taken the deep dive into creating more complex surveys so I could be really missing something here. I have attached a copy of my survey sheet for reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the error I keep receiving:&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/440972_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2019 14:51:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-a-field-based-on-multiple/m-p/875454#M29120</guid>
      <dc:creator>MichaelFazio2</dc:creator>
      <dc:date>2019-04-02T14:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate a field based on multiple conditions?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-a-field-based-on-multiple/m-p/875455#M29121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can not mix and match the if statements with mathematical operator such as + sign. You need to use nested if statements or re-write your expressions to use AND operators and put brackets around each part in your expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Phil.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2019 22:10:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-a-field-based-on-multiple/m-p/875455#M29121</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-04-02T22:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate a field based on multiple conditions?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-a-field-based-on-multiple/m-p/875456#M29122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the same question as you brought up in&amp;nbsp;&lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/thread/210714-if-statement-calculation-survey123#comment-842469" title="https://community.esri.com/thread/210714-if-statement-calculation-survey123#comment-842469"&gt;https://community.esri.com/thread/210714-if-statement-calculation-survey123#comment-842469&lt;/A&gt;&amp;nbsp;, yes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Apr 2019 22:11:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-a-field-based-on-multiple/m-p/875456#M29122</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2019-04-02T22:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate a field based on multiple conditions?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-a-field-based-on-multiple/m-p/875457#M29123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, I first asked as a comment, and then thought it'd be better just to make my own post. I am trying your solution this morning, but also got a comment regarding "nested" if statements, so I'm going to try that too.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2019 13:26:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-a-field-based-on-multiple/m-p/875457#M29123</guid>
      <dc:creator>MichaelFazio2</dc:creator>
      <dc:date>2019-04-03T13:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate a field based on multiple conditions?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-a-field-based-on-multiple/m-p/875458#M29124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I've seen the nested if-statement suggested multiple times and have now moved to this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(${P}&amp;lt;15 and ${TN}&amp;lt;400 and ${ChloroA}&amp;lt;3),"Oligotrophic", if(${P}&amp;gt;15 and &amp;lt;=25, and ${TN}&amp;gt;400 and &amp;lt;=600 and ${ChloroA}&amp;gt;3 and &amp;lt;=600),"Mesotrophic", if(${P}&amp;gt;25 and ${TN}&amp;gt;=600 and ${ChloroA}&amp;gt;=7),"Eutrophic")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I'm still not having any success. I think my parenthesis are off, but cannot figure out how...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2019 14:02:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-a-field-based-on-multiple/m-p/875458#M29124</guid>
      <dc:creator>MichaelFazio2</dc:creator>
      <dc:date>2019-04-03T14:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate a field based on multiple conditions?</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-a-field-based-on-multiple/m-p/875459#M29125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The if() statements need to be nested within each other. &amp;nbsp;For example, if you wanted to determine which school type a student was in by grade (1-6 Elementary, 7-8 Middle, 9-12 High), we can break this into 2 if statements:&lt;/P&gt;&lt;P&gt;1) is the student in an elementary school&lt;/P&gt;&lt;P&gt;2), if 1 is no, is the student in middle school&lt;/P&gt;&lt;P&gt;If 2) is no, we know they are in high school. &amp;nbsp;This gets implemented as&lt;/P&gt;&lt;PRE&gt;if(${grade} &amp;lt;=6, "Elementary", if(${grade} &amp;lt;=8, "Middle", "High"))&lt;/PRE&gt;&lt;P&gt;Note that at the right end there are 2 right parenthesis - one for each if() statement. &amp;nbsp;Also note that I can remove the check in the second if() for grades 1-6 - we already addressed that in the first if() statement. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the formula you have above, you have the evaluation criteria (for example,&amp;nbsp;&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;${P}&amp;lt;15 and ${TN}&amp;lt;400 and ${ChloroA}&amp;lt;3 ), in parenthesis by itself - the true and false values also need to be inside the parenthesis as well;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;if(${P}&amp;lt;15 and ${TN}&amp;lt;400 and ${ChloroA}&amp;lt;3),"Oligotrophic", &amp;lt;Mesotrophic/Eutrophic IF&amp;gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&lt;SPAN&gt;would be the first, with the next if&amp;nbsp;statement in the &lt;SPAN style="background-color: #ffffff;"&gt;&amp;lt;Mesotrophic/Eutrophic IF&amp;gt; area.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Apr 2019 17:53:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-calculate-a-field-based-on-multiple/m-p/875459#M29125</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2019-04-03T17:53:01Z</dc:date>
    </item>
  </channel>
</rss>

