I have a dashboard with three feature layers. Each layer has an indicator that shows the number of features in that layer. I wanted to create an indicator that showed the count of features in all 3 layers combined. So, I used a data expression to return a very simple FeatureSet that contains a single feature with the count of all 3 layers.
The indicators also change values based on options chosen using the selectors. For instance, if a selector is used to filter out features, then the indicators change to reflect how many of those features are still being displayed on the map.
I want the indicator showing the total of all 3 layers to also change to reflect the new sum of the first three layers. However, it doesn't change, and I have no options to select a filter in the indicator properties either.
Is there a way to accomplish this? I know my data expression is probably too simple to accomplish this, but I'm still new to using Arcade.
Solved! Go to Solution.
In order to accomplish this, your "all three" indicator's data expression will need to be a bit more complex. It may not need to include every feature, however.
First, you should identify all the fields your other dashboard elements use to filter these layers.
Then, in your expression, consider using GroupBy to group each of the three layers by the fields in question, returning a count for each unique combination. Then just merge your layers together into a single FeatureSet.
The resulting FeatureSet should have any fields available for your other elements to filter, and by presenting the sum of the count field, would effectively show the total of filtered features.
I'd give an actual expression, but it probably depends a lot on your dashboard and the input layers. Feel free to give specifics, and I could try writing something up. Or if the layers are public, could try to work with them directly.
In order to accomplish this, your "all three" indicator's data expression will need to be a bit more complex. It may not need to include every feature, however.
First, you should identify all the fields your other dashboard elements use to filter these layers.
Then, in your expression, consider using GroupBy to group each of the three layers by the fields in question, returning a count for each unique combination. Then just merge your layers together into a single FeatureSet.
The resulting FeatureSet should have any fields available for your other elements to filter, and by presenting the sum of the count field, would effectively show the total of filtered features.
I'd give an actual expression, but it probably depends a lot on your dashboard and the input layers. Feel free to give specifics, and I could try writing something up. Or if the layers are public, could try to work with them directly.
Thank you for the answer! I wish I could take you up on your offer, but I'm doing this for work, and I don't think they want me sharing the data. I do appreciate the offer though.
I think I can figure out an expression using the advice you gave.
Thank you very much!