Can you tell me how the Cases_current was created un the Coronavirus - it a realted table but how do the pull just the latest data?

1768
8
03-19-2020 01:26 PM
ShayneGray
New Contributor II

Can you tell me how the Cases_current was created un the Coronavirus - it a realted table but how do the pull just the latest data?

8 Replies
MikeSweeney
Esri Contributor

If you mean the Cases_current hosted layer read only view that is created when deploying the COVID-19 solution, it is pointing to the Cases editable hosted feature layer that was also was created at the same time.

From the Settings tab

The Cases_current is used to present a read only view to the public and is used by the Community Impact Dashboard web map which is used in turn by the Community Impact Dashboard operations dashboard.

In a graphic it looks like this:

0 Kudos
ShayneGray
New Contributor II

I was trying to figure out is in the current case view it is only pulling the data that was entered last and also when you look at the table for this view it only shows one line of data and it also pulling the data related table data in to the same table and I just that what I’m asking is how did they get both tables to show in on table

Here is the CASE feature class and the table show the related table with three results

Her is the related table the three results that are referenced above

So here is the View called Cases_current and in the table it shows only the last result that was entered and the related table data and the main table data are shown in the same table and I cannot figure out how that was done – trying to use this for another project for our county EMA department for showing the available supplies the each fire depart has that the beginning of each day ?

0 Kudos
MikeDagle
Esri Contributor

Hi Shayne Gray,

The Cases_current view was created in using Analysis-->Summarize Data-->Join Features in a web map. 

  • Add the Cases feature service to the map viewer. (or whichever table/layer combination you'd like to join)
  • From Analysis open the Join Features tool (within the Summarize Data group).
  • Configure your settings for the join and at the bottom check the option to save the output as a hosted view. The join definition should be 1:1 attribute join based on a common field (we use name in the Cases_current view), and sort on the Report Date (or other date field) field in descending order.

I hope that helps. 

MikeSweeney
Esri Contributor

A little more detail just to explain how this is set up.  As mentioned above by Mike Dagle an attribute join was done between the  Reporting Areas hosted polygon feature layer and a table named Cases based on the common value for name to create the hosted view Current Cases.  

The join always returns the latest record from the Cases table because when the view was created they specified that the latest record should be joined.

Here is what the Reporting Areas attribute table looks like.  It really just has a Name field.

Here is what the Cases table looks like.  It has the Name field and multiple records for the reported cases (maybe one for each day, or perhaps, multiples per day).  I only ever want the latest data to be joined to the Reporting Areas to display in the Current Cases view.

Here is how they created the view for Current Cases 

Analysis > Summarize Data > Join Features

Notice that they checked the box for  Create results as hosted feature layer view


RobertBuckley1
Occasional Contributor

Is it true then, that the feature created by Analysis-->Summarize Data-->Join Features would have to be updated in order to display current data? If true, what is the workflow? Can the analysis be re-run without creating a new feature with a different name? This would be important as the dashboard would otherwise always need to update the data source. 

0 Kudos
ShayneGray
New Contributor II

Since it is a view of the Case hosted feature class when the survey 123 is used to populate the Case hosted feature the Current_Cases is automatically updated uses the join that was described above

0 Kudos
MikeDagle
Esri Contributor

Shaye is correct. As Mike S. shows above Cases_current was created as a feature layer view (the checkbox just above Run Analysis) so the data on the view is always pulled from its sources automatically. 

0 Kudos
JosephRathvon
Occasional Contributor

FYI

I'll tack this on at for anyone else that stumbles across this thread for help with the Cases Solution.  

I needed to add additional fields after the solution was deployed. I had to remove the Cases_Current layer to be able to add fields to Cases.  Also I had to rerun the Join Features to get the new fields into Cases_Current.  The output layer of Join Features wouldn't let me use the same name as an existing layer so I needed to delete Cases_Current for that reason also.

I am not sure if this was all linked but it is what solved it for me.