I have a hydrant inspection layer that I have configured a dashboard for and I am trying to get the indicator widget to reflect the correct number of hydrants still needing inspections. Currently the number is inflated because there are multiple inspections per hydrant. I have been working on trying to create a data expression to create a FeatureSet to filter most recent inspections per hydrant, but I am having no luck. Every code I have tried multiple code combinations, and it just returns an empty dataset.
// Load the hydrant inspections layer
var inspections = FeatureSetByPortalItem(
Portal("https://maps.casselberry.org/portal"),
"f3a4a8879ce34241a5fd139ddfaf727a", // Inspection Layer Item ID
0
);
var maxDate = Text(Date(Max(fs, 'dateinspected')), 'YYYY-MM-DD');
return Filter(fs, 'dateinspected = @maxDate');
This code is based on this github post I had found
Solved! Go to Solution.
This worked! thanks again. 🙂