I'm wondering if I could get some help making an indicator widget that would dynamically calculate the sum of the product of two fields. Particularly, the product of a water mains leak rate and leak time, then sum each product to get a cumulative leak loss. Here's what I have so far, I'm not very familiar with Arcade, so forgive me.
var portal = Portal('https://www.arcgis.com');
var fs = FeatureSetByPortalItem(
portal,
'9ad3138c16dd4c20aca6ca2a1b14dc89',
9,
[
'LEAKRATE',
'LeakDays'
],
false
);
var ratioDict = {
'fields':
{'name':'leaksum', 'type':'esriFieldTypeDouble'},
'geometryType': '',
'features':
[{'attributes':
{'leaksum': (fs, 'LEAKRATE') * (fs, 'LeakDays')
}}]
};
return FeatureSet(SUM(ratioDict));