I am building a Dashboard to analyze my backyard chicken egg/meat production and costs. I am using QuickCapture to collect data and display it on the Dashboard. I am using a Tally to keep track of how many eggs I collect each day and will use the same method when I harvest meat birds and collect the weight of each with the Tally. I also have buttons to collect when I purchase feed and supplies. I will probably add in when I get new meat chicks so I can track their age as well and build a gauge to track when they are at harvest age.

Right now, I have 11 laying hens, and just got 11 more laying chicks. Once they are at laying age, I will update the dashboard to base the laying statistics off the new flock total. This is just an indicator for me to see how productive the flock is overall and to know when my older birds really start slowing down.
I also got 10 meat chicks and will plan on raising 10 meat birds at a time every 2-3 months. I want to track the performance and costs of this whole operation and eventually expand it to the rest of our backyard farm garden.

The feature layer for input costs has a cost field and a weight field. I want to have the dashboard display the Cost/Lb of feed costs. I am not a developer but have tried to piece together the arcade script below and am not having much luck. I want to get this to be able to show the cost per egg and lb of meat I produce.
I would appreciate any help getting this to work. I'm sure this is simply for an arcade developer.
var portal = Portal('https://www.arcgis.com');
var fs = FeatureSetByPortalItem(
portal,
'41da0f418529496993c7917b378a31ae',
0,
[
'cost',
'feedweight'
],
false
);
var ratioDict = {
'fields': [{'name':'costlb', 'type':'esriFieldTypeDouble'}],
'geometryType': '',
'features':
[{'attributes':
{'costlb': (SUM(fs,'cost')/SUM(fs,'feedwegith')),
}}]};
return FeatureSet(Text(ratioDict));