Select to view content in your preferred language

question for ArcGIS online folks

474
3
11-20-2023 02:22 AM
jigrykora
Deactivated User

Hi. questions for ArcGIS online folks. I am trying to create a dashboard. I have a dataset for different type of Injuries (vehicle, gun shot, self, etc...). The type of collision are under two field InjuryType1 and InjuryType2. If I want to create an indicator showing total number of gun shot injury from field Type 1 and 2 how do I do that? Dashboard in ArcGIS online does not have an option to add two fields together. I'm new at this. Any help would be appreciated.

0 Kudos
3 Replies
MobiusSnake
MVP Regular Contributor

Look into creating a Data Expression using Arcade.  These let you derive values from multiple fields, multiple datasets, all sorts of cool things.

RodellZorilla
Regular Contributor

Hello, another option is just to add two instances of the widget and group the widgets together (drag the widget while pressing "shift" on your keyboard.

0 Kudos
JenniferAcunto
Esri Regular Contributor

You can do this by taking advantage of the Reference value. 

First add an indicator and select your data layer. Add a filter so that InjuryType1 is equal to your gunshot value.

JenniferAcunto_0-1701095573751.png

 

Scroll down a bit and expand the Reference section. Change the Reference type to Statistic. Select the same data layer as before, but this time set up your filter to focus on InjuryType2.

JenniferAcunto_1-1701095671123.png

 

The reference value is now displayed at the bottom of your indicator. 

Move to the Indicator tab. Remove {value} and {reference} from your indicator text boxes. 

Next, we are going to use Arcade and Advanced Formatting to sum up our value and reference fields. Click the button Enable Advanced formatting.

You will notice, that some formulas have already been provided for difference, percent, etc. However, there is not one for sum. We can easily add one. Find the difference formula and copy/paste it into a new row. 

JenniferAcunto_2-1701096106034.png

 

Change var difference to var sum and replace - with +

JenniferAcunto_3-1701096181981.png

Now scroll down until you find middleText. Uncomment it by removing the // in front of it if need be and middleText: sum,

JenniferAcunto_4-1701096312618.png

 

Click done. Now we have an Indicator with the sum of two fields.

JenniferAcunto_5-1701096381571.png

 

- Jen
0 Kudos