<?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: Calculating Yearly Quarters in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/806968#M12333</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Though Survey123 Connect does use Microsoft Excel to author surveys, it does not use Microsoft Excel functions. &amp;nbsp;You'll find information on the functions it does support at&amp;nbsp;&lt;A class="link-titled" href="http://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm" title="http://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm"&gt;Formulas—Survey123 for ArcGIS | ArcGIS&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ON determining the quarter of a year, there are a couple of ways to accomplish this. &amp;nbsp;The most important function in this case is the format-date() function, which you can extract the month value, which then can be used in either calculations or regular expression evaluations. &amp;nbsp;Below is a sample calculation to generate "Q1", "Q2", "Q3", "Q4":&lt;/P&gt;&lt;PRE&gt;concat("Q", int(format-date(${d1}, '%n') div 4 + 1))&lt;/PRE&gt;&lt;P&gt;- format-date generates the month as a number&lt;/P&gt;&lt;P&gt;- the month divided by 4 + 1 gets us a value from 1.333 to&amp;nbsp;4.000 that aligns to the quarters&lt;/P&gt;&lt;P&gt;- the int function drops off the fractional component&lt;/P&gt;&lt;P&gt;- the concat function joins the letter Q with the month value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Jan 2018 18:42:43 GMT</pubDate>
    <dc:creator>JamesTedrick</dc:creator>
    <dc:date>2018-01-29T18:42:43Z</dc:date>
    <item>
      <title>Calculating Yearly Quarters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/806967#M12332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to see if anyone had an idea for auto-filling a text field with the correct year quarter based on a series of IF-THEN statements. I am having an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/395165_Untitled.png" style="width: 620px; height: 202px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I presently have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;IF(AND(${INSPECTION_DATE}&amp;gt;=DATE(YEAR(${INSPECTION_DATE}),1,1),${INSPECTION_DATE}&amp;lt;=DATE(YEAR(${INSPECTION_DATE}),3,31)),"Q1",IF(AND(${INSPECTION_DATE}&amp;gt;=DATE(YEAR(${INSPECTION_DATE}),4,1),${INSPECTION_DATE}&amp;lt;=DATE(YEAR(${INSPECTION_DATE}),6,30)),"Q2",IF(AND(${INSPECTION_DATE}&amp;gt;=DATE(YEAR(${INSPECTION_DATE}),7,1),${INSPECTION_DATE}&amp;lt;=DATE(yEAR(${INSPECTION_DATE},9,30)),"Q3",IF(AND(${INSPECTION_DATE}&amp;gt;=DATE(YEAR(${INSPECTION_DATE}),10,1),${INSPECTION_DATE}&amp;lt;=DATE(YEAR(${INSPECTION_DATE}),12,31)),"Q4")))))
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, there are a series of nested IF statements where I am trying to define the range for each quarter of the year. I am using a field that uses a TODAY() [&lt;EM&gt;${INSPECTION_DATE} is TODAY()&lt;/EM&gt;] function to define the correct year for this calculation. Of course this statement works well within Excel itself, but not so much for Survey123 where it cannot parse through my statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it has everything to do with not having the AND(), DATE(), YEAR() functions added into its framework, or having different functionality. I may also be overwhelming the parser.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My ultimate question is if there is a way to calculate a range of dates that are based on &lt;SPAN style="text-decoration: underline;"&gt;set quarters&lt;/SPAN&gt; (month and day), and auto-fill a text field with the correct quarter (Q1, Q2, Q3, Q4) based on the result. &lt;EM&gt;Like I said, the above function works in Excel, but not for the XLSForm syntax.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This is all there really is to it. This field is intended to be read-only&amp;nbsp;and auto-calculated for field inspections.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:24:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/806967#M12332</guid>
      <dc:creator>PaulPanehal</dc:creator>
      <dc:date>2021-12-12T09:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Yearly Quarters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/806968#M12333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Though Survey123 Connect does use Microsoft Excel to author surveys, it does not use Microsoft Excel functions. &amp;nbsp;You'll find information on the functions it does support at&amp;nbsp;&lt;A class="link-titled" href="http://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm" title="http://doc.arcgis.com/en/survey123/desktop/create-surveys/xlsformformulas.htm"&gt;Formulas—Survey123 for ArcGIS | ArcGIS&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ON determining the quarter of a year, there are a couple of ways to accomplish this. &amp;nbsp;The most important function in this case is the format-date() function, which you can extract the month value, which then can be used in either calculations or regular expression evaluations. &amp;nbsp;Below is a sample calculation to generate "Q1", "Q2", "Q3", "Q4":&lt;/P&gt;&lt;PRE&gt;concat("Q", int(format-date(${d1}, '%n') div 4 + 1))&lt;/PRE&gt;&lt;P&gt;- format-date generates the month as a number&lt;/P&gt;&lt;P&gt;- the month divided by 4 + 1 gets us a value from 1.333 to&amp;nbsp;4.000 that aligns to the quarters&lt;/P&gt;&lt;P&gt;- the int function drops off the fractional component&lt;/P&gt;&lt;P&gt;- the concat function joins the letter Q with the month value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 18:42:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/806968#M12333</guid>
      <dc:creator>JamesTedrick</dc:creator>
      <dc:date>2018-01-29T18:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Yearly Quarters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/806969#M12334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for getting back to me James,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have looked into your formula, and it was close to what I needed. I looked through other solutions for excel, and came up with this formula.&lt;/P&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;concat("Q",int((int(format-date(${INSPECTION_DATE}, '%n'))+2) div 3))&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This ensures my quarters are:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Q1: Jan 1 - Mar 30&lt;/LI&gt;&lt;LI&gt;Q2: Apr. 1 - Jun 30&lt;/LI&gt;&lt;LI&gt;Q3: Jul 1 - Sept 30&lt;/LI&gt;&lt;LI&gt;Q4 Oct 1 - Dec 31&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I appreciate you giving me the right footing. This will not somehow be affected by epoch timing, or some other standard, correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jan 2018 21:39:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/806969#M12334</guid>
      <dc:creator>PaulPanehal</dc:creator>
      <dc:date>2018-01-29T21:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Yearly Quarters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/1515812#M58343</link>
      <description>&lt;P&gt;I am trying to do this exact formula, how would I do it if my Q1 is Oct to December?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 21:08:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/1515812#M58343</guid>
      <dc:creator>TKSHEP</dc:creator>
      <dc:date>2024-08-06T21:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Yearly Quarters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/1515852#M58349</link>
      <description>&lt;P&gt;I am&amp;nbsp; trying to do this exact same thing, how would I calculate it if the Q1 starts in October?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2024 22:27:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/1515852#M58349</guid>
      <dc:creator>TKSHEP</dc:creator>
      <dc:date>2024-08-06T22:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Yearly Quarters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/1517450#M58408</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1213"&gt;@JamesTedrick&lt;/a&gt;&amp;nbsp;Is there a way to do this exact thing with the FY Q year starting in October?&amp;nbsp; Thank you so much!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 13:31:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/1517450#M58408</guid>
      <dc:creator>TKSHEP</dc:creator>
      <dc:date>2024-08-09T13:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Yearly Quarters</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/1517451#M58409</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/273207"&gt;@PaulPanehal&lt;/a&gt;&amp;nbsp; is there any way to do this exact thing with the FY Q starting in October?&amp;nbsp; Thank you for any help you can provide.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 13:32:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/calculating-yearly-quarters/m-p/1517451#M58409</guid>
      <dc:creator>TKSHEP</dc:creator>
      <dc:date>2024-08-09T13:32:59Z</dc:date>
    </item>
  </channel>
</rss>

