Select to view content in your preferred language

Issue with arcade used in indicator

62
0
Tuesday
Labels (1)
MicBry
by
Emerging Contributor

Hi!

I have an issue within my dashboard in ArcGIS Enterprise 11.3. I have a category selector that has matching input values as the datasources in my indicator. The category selecter filters the indicator. 

The indicator displays a datapoint-value and a reference-value. They use the same data source and fields, but they are filtered differently. In short, the presentation is supposed to read: 

datapoint (number)

reference (number)

datapoint + reference (numbers combined)

So, whats the issue? The referens value is missing at some locations. This is not wrong, but as it should be. This makes the whole thing fail and show no data. The request "breaks" since the referencevalue isn't even null, it's missing. If i choose a location with my category selector that includes the datapoint but not the reference number the return is no data. I would like the referencevalue to be 0 if missing. 

This is my current script (very simpel): 

var allmannaytor = $datapoint["sum_SHAPE.STArea()"]
var hyresgastskottaytor = $reference["sum_SHAPE.STArea()"]
var total = allmannaytor + hyresgastskottaytor

return {
  //textColor:'',
  //backgroundColor:'',
  topText: 'Allmänna ytor: ' + Text(Round(allmannaytor, 0), "#,###") + ' m²',
  topTextColor: '',
  topTextOutlineColor: '',
  topTextMaxSize: 'medium',
  middleText: 'Hyresgästskötta ytor:  ' + Text(Round(hyresgastskottaytor, 0), "#,###") + ' m²',
  middleTextColor: '',
  middleTextOutlineColor: '',
  middleTextMaxSize: 'medium',
  bottomText: 'Totala ytor: ' + Text(Round(total, 0), "#,###") + ' m²',
  bottomTextColor: '',
  bottomTextOutlineColor: '',
  bottomTextMaxSize: 'x-small',
  //iconName:'',
  //iconAlign:'left',
  //iconColor:'',
  //iconOutlineColor:'',
  //noValue:false,
  //attributes: {
    // attribute1: '',
    // attribute2: ''
  // }
}

 

I have tried using if-functions etc, looking for null, looking for 0, missing, itempty. I can't make anything work. I don't want to find null since the problem is that the referencevalue doesn't even exist in some cases. 

Any suggestions? 

 

 

0 Kudos
0 Replies