I'm trying to build a dashboard list from a feature class that is a lot of polylines, something like this:
What I want the list to show is:
What I've got so far is:
var fs = FeatureSetByPortalItem(Portal('https://arcgis.com/'), 'a454cf97c4264cd2b77f27175e01d3ba', 0, ['TRLNAME','STATE','CONG_DIST'], false);
return GroupBy(fs, ['TRLNAME'],
[{name: 'total_states', expression: 'STATE', statistic: 'COUNT' },
{name: 'total_districts', expression: 'CONG_DIST', statistic: 'Count' }]);
Which gives me
Which is giving me unique trails, but very clearly not the unique state, district for each trail.
How do I narrow down the expression to return unique states,districts for each trail? Not a programmer.....