I'm trying to set up a text widget with a dynamic count of features filtered by a field (e.g. RecordType = Club). The count will change based on map extent and user-selected filters. But I've found that:
My data has a large number of features (up to 20,000) and will have a lot of concurrent users, so I'm conscious of performance. So trying to avoid using Arcade or creating Views just for this purpose.
Any ideas or wisdom, thanks?
we have a similar use case and use an imbedded dashboard element
that only shows the number based on the current users audit failures
this is the dashboard bit
// Write an expression that returns a FeatureSet.
// Documentation: https://arcg.is/3c419TD
// Samples: https://arcg.is/HPbi00
var features = FeatureSetByPortalItem( Portal('https://www.arcgis.com'), '3e9...790d', 1, ['*'], false);
var currentusr = GetUser().username;
var filterwhere = "Audit_Status in ('In Progress') and Survey_by = '"+currentusr+"'" //'Open','In Progress','Query'
var result = Filter(features, filterwhere);
return result;
i set the dashboard to refresh every 15 minutes or so
see if that fits the bill
Stu
Thanks @StuartMoore . I think with Arcade now possible within a text widget in ExB, it would be more efficient than a dashboard embed. I also need continuous refresh, even as the main map pans etc.
Could you set up Data Views to handle the SQL part of the problem? I don't think this should significantly impact performance.
You should be able to use Count on the OBJECTIDs to find the total number of records in the filtered dataset.
Thanks @JeffreyThompson2 ,
Yes I might do that but was trying to avoid views with thousands of features if possible for something that seems quite simple! If setting up views, is it more efficient to set them up within ExB or externally, where I can reduce the fields etc?