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.
Look into creating a Data Expression using Arcade. These let you derive values from multiple fields, multiple datasets, all sorts of cool things.
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.
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.
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.
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.
Change var difference to var sum and replace - with +
Now scroll down until you find middleText. Uncomment it by removing the // in front of it if need be and middleText: sum,
Click done. Now we have an Indicator with the sum of two fields.