<?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 Arcade: Return value from a specific date in table in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-return-value-from-a-specific-date-in-table/m-p/1340739#M74313</link>
    <description>&lt;P&gt;I have a table that is formed like this for example in a geodatabase:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;PreviousValue&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;CurrentValue&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;22/10/2023&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;250&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;315&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm creating an attribute rule whereby when a row is created in the table, the current value would then be automatically entered in the new previous value like so:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;PreviousValue&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;CurrentValue&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;22/10/2023&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;250&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;315&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;23/10/2023&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;315&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;456&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have decided that I can order the date like so:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;var ord = Top(OrderBy(fs, 'Date DESC'), 2);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get the previous date, however I'm trying to return the value in that row. Is there an arcade expression for this? Any help appreciated.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Oct 2023 23:12:04 GMT</pubDate>
    <dc:creator>KristinVernon1</dc:creator>
    <dc:date>2023-10-23T23:12:04Z</dc:date>
    <item>
      <title>Arcade: Return value from a specific date in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-return-value-from-a-specific-date-in-table/m-p/1340739#M74313</link>
      <description>&lt;P&gt;I have a table that is formed like this for example in a geodatabase:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;PreviousValue&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;CurrentValue&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;22/10/2023&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;250&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;315&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm creating an attribute rule whereby when a row is created in the table, the current value would then be automatically entered in the new previous value like so:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;Date&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;PreviousValue&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;CurrentValue&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;22/10/2023&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;250&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;315&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;23/10/2023&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;315&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;456&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have decided that I can order the date like so:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;var ord = Top(OrderBy(fs, 'Date DESC'), 2);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get the previous date, however I'm trying to return the value in that row. Is there an arcade expression for this? Any help appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 23:12:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-return-value-from-a-specific-date-in-table/m-p/1340739#M74313</guid>
      <dc:creator>KristinVernon1</dc:creator>
      <dc:date>2023-10-23T23:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade: Return value from a specific date in table</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-return-value-from-a-specific-date-in-table/m-p/1343001#M74577</link>
      <description>&lt;P&gt;So after talking to esri support they essentially nudged me in the absolute right direction so that I could have figured this out.&lt;/P&gt;&lt;P&gt;Essentially with their help and with my insatiable programming attitude that forces me to do things my way, I took the feature set and pushed the values into an array and worked on the array to give me the value I wanted like so:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;var fs = FeatureSetByName($datastore, "Database.DBO.DatabaseTable");
var fs_arr = []
for(var f in fs) {
   Push(fs_arr, f.CurrentValue)
}
//I don't want the currently entered value I want the previously entered 
//value so I want the second to last entry in the array.
//Also, if the table only has one row we'll get an out of bounds error 
if(Count(fs_arr) &amp;gt; 1){
   Erase(fs_arr, -1);
   var cg = Back(fs_arr);
   return cg;
} else {
   return 0;
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 27 Oct 2023 23:45:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-return-value-from-a-specific-date-in-table/m-p/1343001#M74577</guid>
      <dc:creator>KristinVernon1</dc:creator>
      <dc:date>2023-10-27T23:45:49Z</dc:date>
    </item>
  </channel>
</rss>

