I had an arcade expression in AGOL for a dashboard chart that worked. It got a feature set then grouped them and got statistics. When we transitioned to an enterprise portal it stopped working. I have been able to narrow it down to the multiplier expression. When I add in the multiplier to convert feet to miles it fails, without the multiplier it gives me the sums of the lengths by material as expected. Any insight into how to fix it would be appreciated.
(note the "expression: 'Shape__Length * 100'")
// Fetches features from a public portal item
var fs = FeatureSetByPortalItem(
Portal(""), // portal address
"0", // portal item id
0, // layer id
['Shape__Length', 'material', 'lifecyclestatus','material','installdate'], // fields to include
true // include or exclude geometry
);
var fs_gp = GroupBy(fs, 'material', { name: 'Miles of Main', expression: 'Shape__Length * 100', statistic: 'SUM' });
return fs_gp
(note the "expression: 'Shape__Length'")
// Fetches features from a public portal item
var fs = FeatureSetByPortalItem(
Portal(""), // portal address
"0", // portal item id
0, // layer id
['Shape__Length', 'material', 'lifecyclestatus','material','installdate'], // fields to include
true // include or exclude geometry
);
var fs_gp = GroupBy(fs, 'material', { name: 'Miles of Main', expression: 'Shape__Length', statistic: 'SUM' });
return fs_gp
0 | 107234.9462056696 | 3991 |
81 | 601255.8958062716 | 3986 |
83 | 200.08303812837116 | 4305 |
84 | 309.3819285554025 | 5347 |
88 | 632286.1538853054 | 4000 |
89 | 6610.487433900385 | 4014 |
92 | 166.4203697785626 | 4013 |
95 | 940942.7513223436 | 3984 |