Most recent (max) date in dashboards?

3537
2
Jump to solution
02-05-2020 06:32 AM
JakubSisak
Occasional Contributor III

I would like to show MOST RECENT data in my dashboard. (Using most recent date, not today's date, MOst recent date can vary) I already have feature service layers in my map that are in SDE (SQL Server) which have definition queries to only show most recent data. Works fine in a map but NO dashboards elements will work with these layers - the elements simply don't show any data - a small warning sign is displayed in the element and when i hover over it it says "Cannot Access Data" and the element says "No Data"

The workaround would be to NOT use a definition query in the feature layers in the map and filter the data using MOST RECENT DATE in the Dashboard. But "Latest", "Most Recent", "Max" for a date field is not an option.

Any ideas for a workaround?  My definition query in the feature layers relies on the fact that the back-end database is an SQL Server so "Date_Field IN (SELECT max( Date_Field ) FROM Feature_Class_Name" query works. However this query would not work in FGDB.  Is there any way to make it work in my Dashboard or any other workaround that can display my dashboard data using the MOST RECENT DATE?

Screen capture shows indicator element not being able to access data from a layer that has a "max date" definition query defined:

Indicator Element - when layer in map has Max Date definition query

1 Solution

Accepted Solutions
MollyWatson1
Occasional Contributor

Hi again,

My supervisor found this blog post which is helpful in formatting your elements to only show the data for the most recent date. 

https://community.esri.com/thread/246919-most-recent-feature-in-indicator-widget

To achieve this, Sort By a date field (e.g., last edited) in descending order. Then, set Maximum Features Displayed to 1. It will only display the newest feature.

This method works well if you are using a feature as your source for the dashboard element. If you need to conduct a statistic (like sum) to get the value, then the sorting function isn't available. 

View solution in original post

2 Replies
MollyWatson1
Occasional Contributor

Hi Jakub,

Did you find an answer to this question? I am also interested in learning how to show the most recent date instead of "today." We have several dashboards we have developed as part of our county's COVID-19 response. The data update frequency varies so I am having a difficult time setting up the date filters in my dashboards. I have to manually change the date filters which is very cumbersome. I could set up a custom attribute expression in a web map to get the most recent date, however, the custom expressions can't be used in operations dashboard. So I am also stumped on how to do this.

MollyWatson1
Occasional Contributor

Hi again,

My supervisor found this blog post which is helpful in formatting your elements to only show the data for the most recent date. 

https://community.esri.com/thread/246919-most-recent-feature-in-indicator-widget

To achieve this, Sort By a date field (e.g., last edited) in descending order. Then, set Maximum Features Displayed to 1. It will only display the newest feature.

This method works well if you are using a feature as your source for the dashboard element. If you need to conduct a statistic (like sum) to get the value, then the sorting function isn't available.