<?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: Calculated Expression in Field Maps to Sum Previous Records in ArcGIS Field Maps Questions</title>
    <link>https://community.esri.com/t5/arcgis-field-maps-questions/calculated-expression-in-field-maps-to-sum/m-p/1545062#M9687</link>
    <description>&lt;P&gt;Did you get this figured out?&amp;nbsp; I have a similar situation and I am looking for information on how best to solve it.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Oct 2024 03:06:46 GMT</pubDate>
    <dc:creator>TuckerAlley</dc:creator>
    <dc:date>2024-10-03T03:06:46Z</dc:date>
    <item>
      <title>Calculated Expression in Field Maps to Sum Previous Records</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/calculated-expression-in-field-maps-to-sum/m-p/1284478#M5868</link>
      <description>&lt;P&gt;Hi, I have features with a related table and I am trying to&amp;nbsp;write a calculated expression in Field Maps to calculate a field in the related table that I have added into my Smart Form called "CummulativeNoPhotos".&lt;/P&gt;&lt;P&gt;I'm trying to calculate a field with the sum the values from the field called "NumberPhotos" if the battery was not changed up until the last time the battery was changed. Otherwise I want the calculated field to be calculated to 0.&amp;nbsp; I have a field called "BatteriesChanged" in the related table to denote if the battery was changed and a field called "NumberPhotos" to keep track of the number of photos.&lt;/P&gt;&lt;P&gt;Curtently, it seems like it is summing all of the "NumberPhotos" in the entire related table not just the "NumberPhotos" for the specific feature of interest that I'm filling out a related record for. I am not sure on how to get the result I want.&lt;/P&gt;&lt;P&gt;So far I have this:&lt;/P&gt;&lt;P&gt;var record = Filter($featureset, "BatteriesChanged = 'Y'")&lt;BR /&gt;record = OrderBy(record, "Date")&lt;BR /&gt;if($feature.BatteriesChanged == "Y"){&lt;BR /&gt;return $feature.CummulativeNoOfPhotos = 0;&lt;BR /&gt;} else{&lt;/P&gt;&lt;P&gt;return Sum(record,"NumberPhotos");&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 19:33:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/calculated-expression-in-field-maps-to-sum/m-p/1284478#M5868</guid>
      <dc:creator>GISArchbold</dc:creator>
      <dc:date>2023-05-01T19:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated Expression in Field Maps to Sum Previous Records</title>
      <link>https://community.esri.com/t5/arcgis-field-maps-questions/calculated-expression-in-field-maps-to-sum/m-p/1545062#M9687</link>
      <description>&lt;P&gt;Did you get this figured out?&amp;nbsp; I have a similar situation and I am looking for information on how best to solve it.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2024 03:06:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-field-maps-questions/calculated-expression-in-field-maps-to-sum/m-p/1545062#M9687</guid>
      <dc:creator>TuckerAlley</dc:creator>
      <dc:date>2024-10-03T03:06:46Z</dc:date>
    </item>
  </channel>
</rss>

