AnsweredAssumed Answered

Attribute Rule Arcade Filter Function Issue

Question asked by smithc on May 7, 2019
Latest reply on May 10, 2019 by xander_bakker

Hi

 

I am in the process of creating a attribute rule and are having some issues notably with the Filter function in arcade.

 

The attribute rule is assigned to a polygon feature class (Terminal Serving Areas) so that when a polygon is created or edited it calculates the number of features form another point feature class (Service Points)  that intersect the polygon and writes the count to a field on the polygon. I can get this to work easily with the following arcade:

 

var servicePoints = FeatureSetByName($datastore, "gs_service_point", ["audit_complete"], True);
var servicePointsIntersect = Intersects(servicePoints, $feature);
return (Count(servicePointsIntersect))

 

However the Service Points have a filed (audit_complete) and I want to be able to filter the Service Points so that only certain "types" are counted. In my case the filter is where audit_complete <> 'DNE'

 

So I change my arcade to include the filter:

 

var servicePoints = FeatureSetByName($datastore, "gs_service_point", ["audit_complete"], True);
var servicePointsIntersect = Intersects(servicePoints, $feature);
var servicePointsFilter = Filter(servicePointsIntersect, "audit_complete <> 'DNE'");
return (Count(servicePointsFilter))

 

But I cannot get it to work. No matter what I do it always returns zero! I have tried everything I can think of!!

 

Does anyone have any idea how to get the filter to work? It may be worth noting that the audit_comple filed contains a lot of null values but this should not impact on the query.. 

 

cheers

 

Callum

Outcomes