<?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 Last Known Location query in ArcGIS Viewer for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/last-known-location-query/m-p/663911#M19592</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a map service set up on tracking observation data.&amp;nbsp; Then I point a customized Time slider widget at this tracking data so that the users can select a Vehicle and see where he traveled during a time period or show all the points where he exceeded 100km/h.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now they want to know the Last Known Location for all vehicles.&amp;nbsp; The Tracking widget isn't good enough because in some vehicles the gps unit is shut down when the engine is turned off.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1.&amp;nbsp; Can I use a QueryTask with grouping?&amp;nbsp; In sql I'd do something like "select vehicle, max(date) from trackingData group by vehicle".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2.&amp;nbsp; If no to 1 then should I still use the QueryTask with a "order by date DESC" and then set up a custom renderer to only show the first record for each vehicle?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3.&amp;nbsp; Create a database view to handle the query logic, then include the view in the map service and join it to the tracking data somehow?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas are welcome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Blaise&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Nov 2012 15:27:47 GMT</pubDate>
    <dc:creator>BlaiseMacLean</dc:creator>
    <dc:date>2012-11-02T15:27:47Z</dc:date>
    <item>
      <title>Last Known Location query</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/last-known-location-query/m-p/663911#M19592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a map service set up on tracking observation data.&amp;nbsp; Then I point a customized Time slider widget at this tracking data so that the users can select a Vehicle and see where he traveled during a time period or show all the points where he exceeded 100km/h.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now they want to know the Last Known Location for all vehicles.&amp;nbsp; The Tracking widget isn't good enough because in some vehicles the gps unit is shut down when the engine is turned off.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1.&amp;nbsp; Can I use a QueryTask with grouping?&amp;nbsp; In sql I'd do something like "select vehicle, max(date) from trackingData group by vehicle".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2.&amp;nbsp; If no to 1 then should I still use the QueryTask with a "order by date DESC" and then set up a custom renderer to only show the first record for each vehicle?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3.&amp;nbsp; Create a database view to handle the query logic, then include the view in the map service and join it to the tracking data somehow?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas are welcome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Blaise&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2012 15:27:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/last-known-location-query/m-p/663911#M19592</guid>
      <dc:creator>BlaiseMacLean</dc:creator>
      <dc:date>2012-11-02T15:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Last Known Location query</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/last-known-location-query/m-p/663912#M19593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I just used:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;qry.where += " AND OBJECTID in (select MAX(OBJECTID) from TRACKINGDATA group by Device_ID)";&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Nov 2012 17:07:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/last-known-location-query/m-p/663912#M19593</guid>
      <dc:creator>BlaiseMacLean</dc:creator>
      <dc:date>2012-11-02T17:07:03Z</dc:date>
    </item>
  </channel>
</rss>

