I am working on a Catch Basin Monitoring dashboard. The dashboard needs to summarise activities by watershed. I would like to create ONE simple list that has the following summaries:
Using the "groupby" command as described in this article, I can generate a COUNT by watershed. The trouble is, each of my metrics to report (items 2 - 5 from list above) are within seperate FS's, with Watershed being common. Can I nest, or use multiple returns?
Any hints on how to achieve this are greatly appreciated.
One thought I am having, can I generate a separate list of each metric by watershed and then join them together to create one RETURN. The code below seems to work in the experssion test, but not full excecuted:
var Cleanings = FeatureSetByPortalItem(Portal('https://arcgis.com/'),
'###',
0, ['Watershed','FeatureID','Cleaned','CleaningDate'], false);
var Total = FeatureSetByPortalItem(Portal('https://arcgis.com/'),
'###',
0, ['Watershed','FeatureID'], false);
Var Clean = GroupBy(Cleanings, ['Watershed'], [
{name: 'Cleaned', expression: 'Cleaned', statistic: 'COUNT' }]);
Var Total = GroupBy(Total, ['Watershed'], [
{name: 'total_sites', expression: 'FeatureID', statistic: 'COUNT' }
]);
Return {Clean, Total}
Can I join by attribute Clean and Total and return just the joined table?