Hi - I'm using ArcPro 3.0.0 and I'm new to Arcade. Using Calculate Field, I trying to write a bit of Arcade code so it loops thru the values of existing field which has a string of concatenated values (i.e. -99,1,2). Where an item in this string does not equal -99, I want to append the value to a new array and then ultimately return the Mean of the NewArray. So, given -99,1,2 the resulting Mean should = 1.5
So, I've tried the following code but it doesn't work. It just returns Null values:
var NewArray = []
var OrigArray = split($feature.CONCATENATE_Story_Num, ",")
For (var i in OrigArray) {
If (i!=-99) {
NewArray+=OrigArray[i];
}
}
return Mean(NewArray)
Thanks