When creating a chart or indicator or other type of feature in a Dashboard, I would love to see a Field Calculator (or something similar) to expand the kinds of calculations we can do, and eliminate the need to write 60 lines of code for a simple algebraic equation. I want to do more than what "Statistics" offers and I want to incorporate more than one field -- these expanded options need to result in fully interactive features regardless of the number of Selectors I include in the Dashboard.
Thanks!
I totally agree with this idea.
For example, with a table "CITY" having as fields "CITY_NAME" "POPULATION" "AREA", I would like to be able to display a "DENSITY" indicator which would be the POPULATION/AREA calculation.
I know how to do it by using the reference and going to the lines of code to do $datapoint.SUM_POPULATION/$reference.SUM_AREA. Then, with my category selector set to CITY_NAME, I display the calculated value according to the chosen city.
But for the moment, it is impossible to go further with a 3rd dynamic field in the calculation, which would be dynamic with my category selector.
Let's imagine if I had a NEW_POPULATION field, and I wanted to display a dynamic indicator that would calculate (POPULATION+NEW_POPULATION)/AREA? Or any other calculation mixing several fields.
It would be necessary to be able to create some sort of virtual fields that would do the calculations on the fly, and that could vary depending on the category selector.
In my example, I will create a new virtual field NEW_DENSITY, in which I will do the calculation, and which would then work like any other field.
I tried the thing with a new expression of the type:
var portal = Portal('https://agglo-plainevallee.maps.arcgis.com');
var fs_indicateur = FeatureSetByPortalItem(
portal,
'4d71d1a174a94807946a9413cbb2b1b3',
0,
['*'],
false
)
var f_indicateur = first(fs_indicateur)
var INDICATOR1 = f_indicateur.INDICATOR1
var INDICATOR2 = f_indicateur.INDICATOR2
var TOTAL = INDICATOR1+INDICATOR2
But we would have to do without the first(). Or be able to use a filter() that would be linked to the selector, or datapoint, or something else 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.