Hi!
I have an issue connected to my dashboard and its widgets. I am currently using enterprise 11.3. In short, my dashboard uses a category selector and an indicator. The widgets have different data, but are connected through similar fields.
My indicator uses a datapoint and a redference value. Both use the same data source, however they are filtered in different ways. My first value (datapoint) shows land (m2) that our municipal landlort taker care of. The seconf value shows land that the residents themselves takes care of. The third value is a grouping of the other to. In short:
Datapoint = Area m2
Reference value = other areas m2
Own value = Area + other areas m2
So, to the issue. I have certain areas where the reference value is non existent, i.e. areas where no land is to be taken care of by the residents. This makes the arcade script fail behind the scenes. The indicator returns no data even when an area containt datapoint but not reference value.I would like the reference value to be treated as 0 so that i always get a result.
Down below is a basic interpretation of my script:
Hi!
Thank you so much for reaching out. It didn't work but i appriciate you trying.
Best, Michaela
@MicBry I am not sure this can be done in this manner. I don't think the indicator even gets to the calculation part in the advanced editor, If either the datapoint or the reference can't be evaluated, the indicator defaults to 'No Data'. I ran a couple tests, hard coded a variable in place of the reference, and as soon as I filtered the data to something that the reference couldn't evaluate, the indicator went to no data, even though the advanced editor should have evaluated correctly.
Hi again Neal!
That's my thought as well.. I've run so many test by now and it doesn't seem like it wants to accept any solution if the referencepoint can be seen as non existant. It's unfortionaty, but i'm happy to see that we both reached the same conclusion. Thanks again for taking the time to look further into this for me. Really appriciate it!
/Michaela
@MicBry Maybe a new data expression like this would be the direction to go. It makes a new feature set with the original "sum" and then the new column is zeroed out if it meets the criteria, otherwise it is the sum. You can then build the indicator in the same manner but using the expression as the source.
var portal = Portal('https://www.arcgis.com');
var feature_layer = FeatureSetByPortalItem(portal, 'XXXXXXXXXXXXXXXXXXXX', X, ['SumField', 'CriteriaField']);
var New_Features = [];
for (var f in feature_layer) {
var SumField_Fix = When(
f.CriteriaField == 'Criteria', 0,
f.SumField
);
var New_Feature = {
attributes: {
CriteriaField: f.CriteriaField,
SumField_New: SumField_Fix,
SumField_Old: f.SumField
}
};
Push(New_Features, New_Feature);
}
var out_dict = {
fields: [
{ name: "CriteriaField", type: "esriFieldTypeString" },
{ name: "SumField_New", type: "esriFieldTypeInteger" },
{ name: "SumField_Old", type: "esriFieldTypeInteger" }
],
geometryType: "",
features: New_Features
};
return FeatureSet(Text(out_dict));you would just have to make sure you include the proper fields for your filter/queries.