<?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 implement multiple/nested and/or statements in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-multiple-nested-and-or-statements/m-p/878532#M29905</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ah whoops! good catch, thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Nov 2018 21:04:27 GMT</pubDate>
    <dc:creator>ByronTsang1</dc:creator>
    <dc:date>2018-11-29T21:04:27Z</dc:date>
    <item>
      <title>How to implement multiple/nested and/or statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-multiple-nested-and-or-statements/m-p/878529#M29902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having trouble finding the correct syntax for series of and/or conditions within an IF() calculation. how do AND and OR operators group naturally, and do parenthetical groupings parse correctly when Survey123 does calculations?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In other words: would the following result in valid syntax for something like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(&amp;nbsp; (A and B) or (C and D), [return x], [else return Y] )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;obviously this is simplified, but I'm trying to build a calculate question based on several combined inputs and other calculations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2018 15:47:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-multiple-nested-and-or-statements/m-p/878529#M29902</guid>
      <dc:creator>ByronTsang1</dc:creator>
      <dc:date>2018-11-28T15:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multiple/nested and/or statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-multiple-nested-and-or-statements/m-p/878530#M29903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;as an additional note: I've attempted the IF() statement using typical logical order precedence and WITHOUT parentheses, but Survey123 Connect threw the following error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ODK Validate Errors:&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt; Something broke the parser. See above for a hint.&lt;/P&gt;&lt;P&gt;Dependency cycles amongst the xpath expressions in relevant/calculate&lt;/P&gt;&lt;P&gt;Result: Invalid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My formula was built as follows:&lt;/P&gt;&lt;P&gt;if( (${tree_3_dom}= 'yes' and ${tree_4_dom} = ${tree_3_dom}) or ${tree_4_dom} &amp;gt; ${tree_cover20} or sum(${tree_1_cover_calc}, ${tree_2_cover_calc}, ${tree_3_cover_calc}, ${tree_4_cover_calc}) &amp;lt; ${tree_cover50}, 'yes', 'no')&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Nov 2018 16:23:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-multiple-nested-and-or-statements/m-p/878530#M29903</guid>
      <dc:creator>ByronTsang1</dc:creator>
      <dc:date>2018-11-28T16:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multiple/nested and/or statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-multiple-nested-and-or-statements/m-p/878531#M29904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the issue may be the use of sum(). Based on &lt;A href="https://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm"&gt;the documentation&lt;/A&gt;, sum() expects a repeat, rather than a list of question names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE style="color: #4c4c4c; background-color: white; border: 1px solid #cccccc; font-size: 0.875rem; margin-bottom: 1.55rem;"&gt;&lt;THEAD style="background-color: #efefef; border-bottom: 1px solid #cccccc; font-size: 1rem;"&gt;&lt;TR style="border-bottom: none;"&gt;&lt;TH colspan="1" style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;Function&lt;/TH&gt;&lt;TH colspan="1" style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;Description&lt;/TH&gt;&lt;TH colspan="1" style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;Example&lt;/TH&gt;&lt;/TR&gt;&lt;TR style="border-bottom: none; background-color: #ffffff;"&gt;&lt;TH style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;sum(repeat)&lt;/TH&gt;&lt;TH style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;Returns the sum of all responses to a given question across repeats.&lt;/TH&gt;&lt;TH style="border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-weight: 300; padding: 0.51667rem;"&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;sum(${question})&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;/TABLE&gt;&lt;P&gt;This worked for me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal, monaco, monospace;"&gt;if((${tree_3_dom}= 'yes' and ${tree_4_dom} = ${tree_3_dom}) or ${tree_4_dom} &amp;gt; ${tree_cover20} or (${tree_1_cover_calc} + ${tree_2_cover_calc} + ${tree_3_cover_calc} + ${tree_4_cover_calc}) &amp;lt; ${tree_cover50}, 'yes', 'no')&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2018 00:44:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-multiple-nested-and-or-statements/m-p/878531#M29904</guid>
      <dc:creator>StephenM</dc:creator>
      <dc:date>2018-11-29T00:44:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multiple/nested and/or statements</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-multiple-nested-and-or-statements/m-p/878532#M29905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ah whoops! good catch, thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2018 21:04:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/how-to-implement-multiple-nested-and-or-statements/m-p/878532#M29905</guid>
      <dc:creator>ByronTsang1</dc:creator>
      <dc:date>2018-11-29T21:04:27Z</dc:date>
    </item>
  </channel>
</rss>

