Select to view content in your preferred language

Use DateDiff function in Operations Dashboard Indicator?

680
1
Jump to solution
06-04-2018 07:01 AM
JamieLeitch1
New Contributor III

I've got an operations dashboard set up in AGOL.  I want to add an indicator to the dashboard that shows the number of records that have EditDate attribute that is within 14 days after the CreationDate attribute.  It doesn't seem possible to do a calculation like this in dashboard.  I thought maybe I could create a Feature Layer View with a calculated attribute, but it doesn't seem possible.  Is there a way to do this?

0 Kudos
1 Solution

Accepted Solutions
JamieLeitch1
New Contributor III

I just discovered ArcGIS Online Assistant.  First I created a new hosted feature layer view in AGOL and set a filter on it.  Then I logged into AGOL Assistant and selected "View an Item's JSON" in the "I Want to..." menu.  I then selected the new feature layer view and scrolled down to the Data window.  I clicked the edit icon at the top of this window and found the layer definition property "layerDefinition".  Then I edited the JSON to look like this:

"layerDefinition": {
"definitionExpression": "EditDate <=DATEADD(day,14,convert(date,CreationDate))",
"defaultVisibility": true
}

And this seems to have worked!

View solution in original post

0 Kudos
1 Reply
JamieLeitch1
New Contributor III

I just discovered ArcGIS Online Assistant.  First I created a new hosted feature layer view in AGOL and set a filter on it.  Then I logged into AGOL Assistant and selected "View an Item's JSON" in the "I Want to..." menu.  I then selected the new feature layer view and scrolled down to the Data window.  I clicked the edit icon at the top of this window and found the layer definition property "layerDefinition".  Then I edited the JSON to look like this:

"layerDefinition": {
"definitionExpression": "EditDate <=DATEADD(day,14,convert(date,CreationDate))",
"defaultVisibility": true
}

And this seems to have worked!

0 Kudos