Hello,
I see there are a few other questions about his error, but I didn't see anything telling me what the really is causing the issues here. I am using a view in a attribute rule to get a feature set that I use a filter on to get a subset.
- Can I use a view in a attribute rule, or does featuresetbyname work for a view?
- What does "Class was not Found%s" mean? Is this a feature class that is not found, are there null values in the attribute rule?
var quad = $feature.Quadrant;
if ($feature.Quadrant != null) {
var System_valve_set = filter(featuresetbyname($datastore, 'Valve', ['OBJECTID', 'WATERVALVETURNING_STATUS', 'GRID_NUM'], true), Concatenate(["GRID_NUM = ", quad], ''))
var Valves_Exercised_This_Year = filter(featuresetbyname($datastore, 'Valve_Exercised_This_Year', ['OBJECTID', 'Status', 'GRID_NUM'], true), Concatenate(["GRID_NUM = ", quad], ''))
var cnt = count(System_valve_set)
// make the query for each possible situation where there could be a feature set that is null
if (Valves_Exercised_This_Year != null && cnt > 0) {
var query = "Status = 'Closed'"
var System_closed_valve_set = filter(Valves_Exercised_This_Year, query)
var result = count(System_valve_set) - count(System_closed_valve_set)
return result
}
else { return null }
}
else { return null }
regards,
Jim