<?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 Data Expressions using GroupBy and Filter in ArcGIS Dashboards Questions</title>
    <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions-using-groupby-and-filter/m-p/1111760#M5312</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've got a data set that includes data for two different locations ("location" field, string)&amp;nbsp; and I'm trying to create a data expression that returns the number of people ("people" field, integer)&amp;nbsp; at each location based on the most recent record ("&lt;SPAN&gt;data_date" field, date)&amp;nbsp;&lt;/SPAN&gt;for each location.&lt;/P&gt;&lt;P&gt;I've looked at the GitHub examples for GroupBy and MostRecentRecord and I think I need to kind of combine these but haven't had any luck so far.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;TABLE width="264"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="112"&gt;data_date&lt;/TD&gt;&lt;TD width="88"&gt;location&lt;/TD&gt;&lt;TD width="64"&gt;people&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/5/2021 16:00&lt;/TD&gt;&lt;TD&gt;location_1&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/5/2021 16:00&lt;/TD&gt;&lt;TD&gt;location_2&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9/22/2021 16:00&lt;/TD&gt;&lt;TD&gt;location_1&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9/24/2021 16:00&lt;/TD&gt;&lt;TD&gt;location_2&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want returned:&lt;/P&gt;&lt;TABLE width="237"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="105"&gt;data_date&lt;/TD&gt;&lt;TD width="68"&gt;location&lt;/TD&gt;&lt;TD width="64"&gt;people&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/5/2021 16:00&lt;/TD&gt;&lt;TD&gt;location_1&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/5/2021 16:00&lt;/TD&gt;&lt;TD&gt;location_2&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated! Thanks!&lt;/P&gt;&lt;P&gt;Molly (she/hers)&lt;/P&gt;</description>
    <pubDate>Wed, 27 Oct 2021 17:39:06 GMT</pubDate>
    <dc:creator>MollyVetter</dc:creator>
    <dc:date>2021-10-27T17:39:06Z</dc:date>
    <item>
      <title>Data Expressions using GroupBy and Filter</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions-using-groupby-and-filter/m-p/1111760#M5312</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I've got a data set that includes data for two different locations ("location" field, string)&amp;nbsp; and I'm trying to create a data expression that returns the number of people ("people" field, integer)&amp;nbsp; at each location based on the most recent record ("&lt;SPAN&gt;data_date" field, date)&amp;nbsp;&lt;/SPAN&gt;for each location.&lt;/P&gt;&lt;P&gt;I've looked at the GitHub examples for GroupBy and MostRecentRecord and I think I need to kind of combine these but haven't had any luck so far.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data:&lt;/P&gt;&lt;TABLE width="264"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="112"&gt;data_date&lt;/TD&gt;&lt;TD width="88"&gt;location&lt;/TD&gt;&lt;TD width="64"&gt;people&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/5/2021 16:00&lt;/TD&gt;&lt;TD&gt;location_1&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/5/2021 16:00&lt;/TD&gt;&lt;TD&gt;location_2&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9/22/2021 16:00&lt;/TD&gt;&lt;TD&gt;location_1&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;9/24/2021 16:00&lt;/TD&gt;&lt;TD&gt;location_2&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want returned:&lt;/P&gt;&lt;TABLE width="237"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="105"&gt;data_date&lt;/TD&gt;&lt;TD width="68"&gt;location&lt;/TD&gt;&lt;TD width="64"&gt;people&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/5/2021 16:00&lt;/TD&gt;&lt;TD&gt;location_1&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;10/5/2021 16:00&lt;/TD&gt;&lt;TD&gt;location_2&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated! Thanks!&lt;/P&gt;&lt;P&gt;Molly (she/hers)&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2021 17:39:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions-using-groupby-and-filter/m-p/1111760#M5312</guid>
      <dc:creator>MollyVetter</dc:creator>
      <dc:date>2021-10-27T17:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expressions using GroupBy and Filter</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions-using-groupby-and-filter/m-p/1112020#M5318</link>
      <description>&lt;P&gt;Something like this?&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var fs = FeatureSetByName(...)
var last_date = First(OrderBy(fs, "data_date DESC")).data_date
return Filter(fs, "data_date= @last_date")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 28 Oct 2021 09:09:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions-using-groupby-and-filter/m-p/1112020#M5318</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-10-28T09:09:17Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expressions using GroupBy and Filter</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions-using-groupby-and-filter/m-p/1112150#M5320</link>
      <description>&lt;P&gt;Thanks so much Johannes! That worked! Just needed to use "&lt;SPAN&gt;&amp;gt;=" in the filter.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 15:19:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions-using-groupby-and-filter/m-p/1112150#M5320</guid>
      <dc:creator>MollyVetter</dc:creator>
      <dc:date>2021-10-28T15:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Data Expressions using GroupBy and Filter</title>
      <link>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions-using-groupby-and-filter/m-p/1112341#M5325</link>
      <description>&lt;P&gt;Glad it worked. Please accept the answer, so that your question shows up as answered.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 07:32:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-dashboards-questions/data-expressions-using-groupby-and-filter/m-p/1112341#M5325</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2021-10-29T07:32:18Z</dc:date>
    </item>
  </channel>
</rss>

