<?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: Arcade filter code not working in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-filter-code-not-working/m-p/1494985#M84757</link>
    <description>&lt;P&gt;Are you sure the issue is date related?&amp;nbsp; If you remove the date-related queries do the other queries work as expected?&amp;nbsp; If the GRID_ID query is not working correctly for some reason, then it won't matter whether the MARKED_YEAR query is working or not.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jun 2024 15:55:12 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2024-06-19T15:55:12Z</dc:date>
    <item>
      <title>Arcade filter code not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-filter-code-not-working/m-p/1494968#M84754</link>
      <description>&lt;P&gt;I am trying to populate a field 'MARK_X_DATE' with a date value from another layer in field calculator on ArcGIS Pro. However, I only want it to pull the date if both GRID_ID and PROJECT/MARKED_YEAR are the same. MARK_X_DATE is a date only field, and DATE_TIME is a date field (has both date and time).&lt;/P&gt;&lt;P&gt;There are many instances where these filters should be met, but I keep getting a null output. I should note too I've used this in another context in agol, and while I was not pulling a date field I was summing a long field, it worked. So I wonder if something to do with the dates is off. Any thoughts very much appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;var P = Portal('https://www.arcgis.com');
var tree = FeatureSetByPortalItem(P,'20d935a4b9e740eea4b931ddfc91887b',0,['DATE_TIME','PROJECT','GRID_ID'],False)

var filter_by_grid = "'" + $feature["GRID_ID"] + "'"

var filter_by_year = "'" + $feature["MARKED_YEAR"] + "'"

// the filter expression
var filter_expression_grid = "GRID_ID = " + filter_by_grid

var filter_expression_year = "PROJECT = " + filter_by_year

// filter the plots to only this block
var filtered_grid = filter(tree, filter_expression_grid)

var filtered_year = filter(filtered_grid, filter_expression_year)

// get the count of plots

var date = DateOnly(filtered_year, 'DATE_TIME')

return date
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 15:36:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-filter-code-not-working/m-p/1494968#M84754</guid>
      <dc:creator>RileyScanlan</dc:creator>
      <dc:date>2024-06-19T15:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade filter code not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-filter-code-not-working/m-p/1494985#M84757</link>
      <description>&lt;P&gt;Are you sure the issue is date related?&amp;nbsp; If you remove the date-related queries do the other queries work as expected?&amp;nbsp; If the GRID_ID query is not working correctly for some reason, then it won't matter whether the MARKED_YEAR query is working or not.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 15:55:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-filter-code-not-working/m-p/1494985#M84757</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-06-19T15:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade filter code not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-filter-code-not-working/m-p/1494986#M84758</link>
      <description>&lt;P&gt;Yeah I tried it with just the GRID_ID filter and still not getting any output&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 16:00:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-filter-code-not-working/m-p/1494986#M84758</guid>
      <dc:creator>RileyScanlan</dc:creator>
      <dc:date>2024-06-19T16:00:55Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade filter code not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcade-filter-code-not-working/m-p/1495004#M84762</link>
      <description>&lt;P&gt;Beyond the filters, you are not correctly using the ArcGIS Arcade DateOnly function.&amp;nbsp; You are passing the function a feature set and column name, which it has no idea what to do with, so that could be why null is getting returned.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 16:17:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcade-filter-code-not-working/m-p/1495004#M84762</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2024-06-19T16:17:44Z</dc:date>
    </item>
  </channel>
</rss>

