I have a hosted feature layer in my portal in which I have a field named district and it has records like A, A, A, B, C, C. I essentially want to get total count of A, B, C and display it as label.
I understand this can be achieved using Count & Filter function of Arcade however, am on ArcGIS Enterprise 10.9.1 in which Filter function is not present.
As an alternate I have tried the following code:
var countf = 0
var test = $feature.districts
//var test1 = Split(test, ",")
for (var i = 0; i < test; i++){
if (test[i] == $feature.districts[i]){
countf = countf + 1
}
};
The code is not giving me any error however, am not getting correct result. I believe I am missing out on the syntax.
Any insights would be helpful.