<?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: Expression-create new field with value difference from two different dates in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/expression-create-new-field-with-value-difference/m-p/1332326#M54757</link>
    <description>&lt;P&gt;Thank you, I really appreciate it!&lt;/P&gt;&lt;P&gt;I get that time diff part, but I need to display the etmhours field attribute. So in essence I am get hours from one date and subtract from another date. It would be curretm - prevetm. Current date would be the last and most current date, subtracted from the second last current date or the previous to current. I hope I didn't totally confuse you now???!!! Any ideas on how to accomplish this? I am trying to avoid writing a 10 page script as well. Things take forever with Arcade, I so miss attribute assistant, so much easier in VB.&lt;/P&gt;&lt;P&gt;Any input much appreciated!&lt;/P&gt;</description>
    <pubDate>Tue, 26 Sep 2023 10:49:16 GMT</pubDate>
    <dc:creator>TomKukitz</dc:creator>
    <dc:date>2023-09-26T10:49:16Z</dc:date>
    <item>
      <title>Expression-create new field with value difference from two different dates</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/expression-create-new-field-with-value-difference/m-p/1329676#M54651</link>
      <description>&lt;P&gt;Hi I am looking to create a new field from an expression. I have a survey123 form feature layer where I am collecting pump hour readings twice a week and I want to calculate run hours from the current reading&amp;nbsp; from the previous reading. Does anyone have a script for this? I am struggling to get the difference between a current date reading and a previous date reading. HELP???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TomKukitz_0-1695053294679.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/80913iEF73773A7855A047/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TomKukitz_0-1695053294679.png" alt="TomKukitz_0-1695053294679.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 16:10:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/expression-create-new-field-with-value-difference/m-p/1329676#M54651</guid>
      <dc:creator>TomKukitz</dc:creator>
      <dc:date>2023-09-18T16:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: Expression-create new field with value difference from two different dates</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/expression-create-new-field-with-value-difference/m-p/1332156#M54737</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/674685"&gt;@TomKukitz&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;&lt;P&gt;you can calculate the difference between two dates using the DateDiff function in Arcade. You can find more information about it in the &lt;A href="https://developers.arcgis.com/arcade/function-reference/date_functions/#datediff" target="_blank" rel="noopener"&gt;reference documentation here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically this function calculates the amount of time between two dates in the units that you choose (minutes, hours, days, months, years, etc). Here is a sample code block:&amp;nbsp;&lt;/P&gt;&lt;P&gt;var startDate = Date($feature.&lt;EM&gt;yourstartDateFieldhere&lt;/EM&gt;);&lt;BR /&gt;var endDate = Date($feature.&lt;EM&gt;yourendDateFieldhere&lt;/EM&gt;);&lt;BR /&gt;var diff = DateDiff(endDate, startDate, '&lt;EM&gt;enter your desired units here ie&lt;/EM&gt; hours');&lt;BR /&gt;return diff&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Feb 2026 16:54:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/expression-create-new-field-with-value-difference/m-p/1332156#M54737</guid>
      <dc:creator>EmilyGeo</dc:creator>
      <dc:date>2026-02-13T16:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: Expression-create new field with value difference from two different dates</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/expression-create-new-field-with-value-difference/m-p/1332326#M54757</link>
      <description>&lt;P&gt;Thank you, I really appreciate it!&lt;/P&gt;&lt;P&gt;I get that time diff part, but I need to display the etmhours field attribute. So in essence I am get hours from one date and subtract from another date. It would be curretm - prevetm. Current date would be the last and most current date, subtracted from the second last current date or the previous to current. I hope I didn't totally confuse you now???!!! Any ideas on how to accomplish this? I am trying to avoid writing a 10 page script as well. Things take forever with Arcade, I so miss attribute assistant, so much easier in VB.&lt;/P&gt;&lt;P&gt;Any input much appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 10:49:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/expression-create-new-field-with-value-difference/m-p/1332326#M54757</guid>
      <dc:creator>TomKukitz</dc:creator>
      <dc:date>2023-09-26T10:49:16Z</dc:date>
    </item>
  </channel>
</rss>

