Select to view content in your preferred language

Arcade script issue

806
9
Jump to solution
06-07-2024 02:32 PM
Labels (3)
CallahanWalker
Emerging Contributor

I am creating a dashboard on ARCGIS Online and am wanting to add an indicator. The indicator I want to create requires me to create a new data expression. I want it to show the Call Percentage, which would be the total count of the "Code" field/ total count of the "Dispositions" field. The majority of the data in the dispositions field is empty if that helps. I figured out how to run it and get the correct output, but whenever I press Done it says that "Unable to execute Arcade script". It looks like I need to return a FeatureSet instead of text, but I run into even more problems when I try to return a FeatureSet it says"error: Execution error - Cannot access value using a key of this type. Verify test data". Can anyone help me with this?

0 Kudos
2 Solutions

Accepted Solutions
JenniferAcunto
Esri Regular Contributor

From what you've described, you don't need a Data Expression. Make the Code value your normal indicator data value, use the Reference field to grab the Dispositions value, and then display the {ratio} in the indicator display. Similar to the first example that sums two fields, but you don't even need to get into the Advanced Formatting section Dashboards That Pop: Indicator Hacks.

- Jen

View solution in original post

JenniferAcunto
Esri Regular Contributor

Add a data source filter.

JenniferAcunto_0-1718106997705.png

 

- Jen

View solution in original post

9 Replies
jcarlson
MVP Esteemed Contributor

Sharing your expression would be helpful in figuring it out. It sounds like a simple enough problem, but it's hard to know exactly what's wrong without seeing it.

- Josh Carlson
Kendall County GIS
JenniferAcunto
Esri Regular Contributor

From what you've described, you don't need a Data Expression. Make the Code value your normal indicator data value, use the Reference field to grab the Dispositions value, and then display the {ratio} in the indicator display. Similar to the first example that sums two fields, but you don't even need to get into the Advanced Formatting section Dashboards That Pop: Indicator Hacks.

- Jen
CallahanWalker
Emerging Contributor

Thank you so much for this. Can I somehow make the indicator update as I zoom in and out of the map? 

0 Kudos
JenniferAcunto
Esri Regular Contributor

Add a Map Action to the map and target your indicator. You will probably want to target both the value and reference value.

- Jen
CallahanWalker
Emerging Contributor

Also, if I want to create indicators based on a specific value in a field, can I do so this way? For instance I want to reference only the dispositions where the value is "SOLD" in an equation.

0 Kudos
JenniferAcunto
Esri Regular Contributor

Add a data source filter.

JenniferAcunto_0-1718106997705.png

 

- Jen
CallahanWalker
Emerging Contributor

Thank you so much for the help. If I want to use division instead of a ratio or percentage, would I have to use advanced formatting?

0 Kudos
JenniferAcunto
Esri Regular Contributor

Ratio is just the value divided by the reference but if you wanted some other math, then yes you would set that up using the Advanced Formatting.

- Jen
j1assa
by
Deactivated User

I am creating a dashboard on ARCGIS Online and am wanting to add an indicator. The indicator I want to create requires me to create a new data expression. I want it to show the Call Percentage, which would be the total count of the "Code" field/ total count of the "Dispositions" field. The majority of the data in the dispositions field is empty if that helps. I figured out how to run it and get the correct output, but whenever I press Done it says that "Unable to execute Arcade script". It looks like I need to return a FeatureSet instead of text, but I run into even more problems when I try to return a FeatureSet it says"error: Execution error - Cannot access value using a key of this type. Verify test data". Can anyone help me with this?

0 Kudos