<?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 If Statement Calculation with Integer Questions in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-calculation-with-integer-questions/m-p/783255#M6631</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am building a soil mapping survey and am having a problem with one of my calculations.&amp;nbsp; I have repeat questions related to the soil's profile.&amp;nbsp; Each repeat represents a soil horizon.&amp;nbsp; Some of the properties that need to be captured is the Upper and Lower depths.&amp;nbsp; What I am attempting to do is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if HORIZON_NO = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;UPPER = 0&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;UPPER = LOWER_MAX&lt;/P&gt;&lt;P&gt;LOWER_MAX is the max of the LOWER measurement recorded in the repeats.&amp;nbsp; Essentially the first horizon will have an UPPER measure (depth) of 0.&amp;nbsp; The second repeat or horizons will now automatically populate the upper to equal the previous lower.&amp;nbsp; The code that I used is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if (${HORIZON_NO}=1, 0, ${LOWER_MAX})&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/511375_pastedImage_4.png" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;What ends up happening is that first repeat does not get a 0 and when I capture a second repeat it actually concatenates the 1 and 0 from my if statement.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/511399_pastedImage_7.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Oct 2020 19:36:06 GMT</pubDate>
    <dc:creator>DanBihari</dc:creator>
    <dc:date>2020-10-20T19:36:06Z</dc:date>
    <item>
      <title>If Statement Calculation with Integer Questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-calculation-with-integer-questions/m-p/783255#M6631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am building a soil mapping survey and am having a problem with one of my calculations.&amp;nbsp; I have repeat questions related to the soil's profile.&amp;nbsp; Each repeat represents a soil horizon.&amp;nbsp; Some of the properties that need to be captured is the Upper and Lower depths.&amp;nbsp; What I am attempting to do is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if HORIZON_NO = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;UPPER = 0&lt;/P&gt;&lt;P&gt;else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;UPPER = LOWER_MAX&lt;/P&gt;&lt;P&gt;LOWER_MAX is the max of the LOWER measurement recorded in the repeats.&amp;nbsp; Essentially the first horizon will have an UPPER measure (depth) of 0.&amp;nbsp; The second repeat or horizons will now automatically populate the upper to equal the previous lower.&amp;nbsp; The code that I used is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if (${HORIZON_NO}=1, 0, ${LOWER_MAX})&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/511375_pastedImage_4.png" /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;What ends up happening is that first repeat does not get a 0 and when I capture a second repeat it actually concatenates the 1 and 0 from my if statement.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/511399_pastedImage_7.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Oct 2020 19:36:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-calculation-with-integer-questions/m-p/783255#M6631</guid>
      <dc:creator>DanBihari</dc:creator>
      <dc:date>2020-10-20T19:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement Calculation with Integer Questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-calculation-with-integer-questions/m-p/783256#M6632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;A href="https://community.esri.com/migrated-users/12479"&gt;Dan Bihari&lt;/A&gt;‌,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the second repeat or the HORIZON_REPEAT nested within a repeat that LOWER_MAX is contained in? Additionally is there a repeat count set for either the outer or nested repeat?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so we have a few issues with calculations in nested repeats.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If possible would I be able to obtain a copy of your XLSForm for testing on our end to confirm if this is the same behavior as our issue?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zach&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2020 02:00:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-calculation-with-integer-questions/m-p/783256#M6632</guid>
      <dc:creator>ZacharySutherby</dc:creator>
      <dc:date>2020-10-22T02:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement Calculation with Integer Questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-calculation-with-integer-questions/m-p/783257#M6633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Zach,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For some reason my GeoNet is all messed up and I am having trouble using it on a consistant basis. I assume that it’s related to the GeoNet migration. I hope you don’t mind that I respond to you directly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what I am trying to do is once a soil pit is dug you have multiple soil horizons. Each repeat represents a new soil horizon. With each soil horizon you have an upper measurement, which start at 0, and a lower measurement which represent the depth. What I’m attempting to do is as the second repeat is started, the lower measurement from the first repeat is automatically enter in for the upper of the second repeat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First Repeat&lt;/P&gt;&lt;P&gt;Upper – 0&lt;/P&gt;&lt;P&gt;Lower – 25&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second Repeat&lt;/P&gt;&lt;P&gt;Upper – 25&lt;/P&gt;&lt;P&gt;Lower – 45&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Third Repeat&lt;/P&gt;&lt;P&gt;Upper – 45&lt;/P&gt;&lt;P&gt;Lower – 60&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Etc…&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This work starts at row 111 and my LOWER_MAX calc is on row 87.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your help Zach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Dan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan Bihari (he/him)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Senior Geographic Information Specialist&lt;/P&gt;&lt;P&gt;Resource Information Business Services Unit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2020 13:28:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-calculation-with-integer-questions/m-p/783257#M6633</guid>
      <dc:creator>DanBihari</dc:creator>
      <dc:date>2020-10-22T13:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement Calculation with Integer Questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-calculation-with-integer-questions/m-p/783258#M6634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I do this as well for my Soil Pits.&amp;nbsp; I cant tell who you work for it may be similar then I could share my forms.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the trick I got was to use once hidden field and a once so that it stays put and does not recalc on me.&amp;nbsp; I also add the 0 to the max.&amp;nbsp; I forget my process since it was a few years ago but it works.&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="511560" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/511560_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="511561" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/511561_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2020 13:47:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-calculation-with-integer-questions/m-p/783258#M6634</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2020-10-22T13:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement Calculation with Integer Questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-calculation-with-integer-questions/m-p/783259#M6635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Doug…&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YOU ARE A GENIUS!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you SOOO much.  That worked perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~Dan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dan Bihari  (he/him)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Senior Geographic Information Specialist&lt;/P&gt;&lt;P&gt;Resource Information Business Services Unit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2020 14:05:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-calculation-with-integer-questions/m-p/783259#M6635</guid>
      <dc:creator>DanBihari</dc:creator>
      <dc:date>2020-10-22T14:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: If Statement Calculation with Integer Questions</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-calculation-with-integer-questions/m-p/783260#M6636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cool.&amp;nbsp; Please mark the post as correct.&amp;nbsp; thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2020 14:08:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/if-statement-calculation-with-integer-questions/m-p/783260#M6636</guid>
      <dc:creator>DougBrowning</dc:creator>
      <dc:date>2020-10-22T14:08:22Z</dc:date>
    </item>
  </channel>
</rss>

