<?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: Creating an expression for an indicator that only shows the most recent month's data in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-an-expression-for-an-indicator-that-only/m-p/1209428#M6768</link>
    <description>&lt;P&gt;Do you want to return records from the last month as of today's date? You can use the DateAdd function to calculate that date, then use that date to filter the records.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fields = ["objectid", "date", "category", "closed"]
var fs = FeatureSetByPortalItem(Portal("PORTAL NAME"), "LAYER ID", 0, fields)
var open_issues = Filter(fs, "closed = 'No'")

var lastMonth = Text(DateAdd(Today(), -1, 'months'), 'MM/DD/YYYY');
var subsetByDate = Filter(open_issues, "date &amp;gt; @lastMonth")
return subsetByDate&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Sep 2022 21:28:44 GMT</pubDate>
    <dc:creator>KenBuja</dc:creator>
    <dc:date>2022-09-02T21:28:44Z</dc:date>
    <item>
      <title>Creating an expression for an indicator that only shows the most recent month's data</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-an-expression-for-an-indicator-that-only/m-p/1209366#M6767</link>
      <description>&lt;P&gt;I'm trying to create an indicator in my dashboard that includes only the records in my dataset from the month associated with the most recent records. (I don't want to use the built in Last Month option in the Data options section of the indicator because there will be a lag at the beginning of each month when the dashboard is updated.)&lt;/P&gt;&lt;P&gt;I'm trying to write an Arcade expression for this but am a newcomer and am struggling a bit with this.&lt;/P&gt;&lt;P&gt;Right now my expressions runs but it only returns the records associated with the latest date, not all of the records in the latest month which is what I want. See expression below - if I change YYYY-MM-DD in the 4th line to MMM, then no records are returned.&lt;/P&gt;&lt;P&gt;I feel like there's probably a very simple solution to this but I can't seem to figure it out.&lt;/P&gt;&lt;P&gt;Any suggestions are appreciated.&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;Samara&lt;/P&gt;&lt;P&gt;var fields = ["objectid", "date", "category", "closed"]&lt;BR /&gt;var fs = FeatureSetByPortalItem(Portal("PORTAL NAME"), "LAYER ID", 0, fields)&lt;BR /&gt;var open_issues = Filter(fs, "closed = 'No'")&lt;/P&gt;&lt;P&gt;var maxDate = Text(Date(Max(open_issues, 'date')), 'YYYY-MM-DD')&lt;/P&gt;&lt;P&gt;var subsetByDate = Filter(open_issues, "date = @maxDate")&lt;BR /&gt;return subsetByDate&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 19:49:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/creating-an-expression-for-an-indicator-that-only/m-p/1209366#M6767</guid>
      <dc:creator>WorcesterGTSS</dc:creator>
      <dc:date>2022-09-02T19:49:55Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an expression for an indicator that only shows the most recent month's data</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-an-expression-for-an-indicator-that-only/m-p/1209428#M6768</link>
      <description>&lt;P&gt;Do you want to return records from the last month as of today's date? You can use the DateAdd function to calculate that date, then use that date to filter the records.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fields = ["objectid", "date", "category", "closed"]
var fs = FeatureSetByPortalItem(Portal("PORTAL NAME"), "LAYER ID", 0, fields)
var open_issues = Filter(fs, "closed = 'No'")

var lastMonth = Text(DateAdd(Today(), -1, 'months'), 'MM/DD/YYYY');
var subsetByDate = Filter(open_issues, "date &amp;gt; @lastMonth")
return subsetByDate&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 21:28:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/creating-an-expression-for-an-indicator-that-only/m-p/1209428#M6768</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2022-09-02T21:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Creating an expression for an indicator that only shows the most recent month's data</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/creating-an-expression-for-an-indicator-that-only/m-p/1209813#M6776</link>
      <description>&lt;P&gt;Yes, this allows me to do what I'm aiming for - thank you so much!&lt;/P&gt;&lt;P&gt;Samara&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 12:26:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/creating-an-expression-for-an-indicator-that-only/m-p/1209813#M6776</guid>
      <dc:creator>WorcesterGTSS</dc:creator>
      <dc:date>2022-09-06T12:26:11Z</dc:date>
    </item>
  </channel>
</rss>

