Ops Dashboard for Backyard Chickens

507
2
Jump to solution
06-01-2023 04:53 PM
Labels (1)
AndyMinor2
New Contributor III

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. 

AndyMinor2_0-1685662543577.png

 

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.

 

AndyMinor2_0-1685662216573.png

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)); 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
JenniferAcunto
Esri Regular Contributor

Are you trying to display this in an indicator? If so, you don't even need to use Arcade. In your indicator, set your Statistic to Sum and the Field to Cost. Then add a statistic reference. Set the Statistic to Sum and the Field to Feedweight. 

In my example, I've used population for Cost and area for Feedweight. 

JenniferAcunto_0-1685709140056.png

Next, move over to the indicator tab. Remove {value} and {reference} from the indicator and instead add {ratio}. Tip: click on the curly brackets to see all the built in formulas available to you when using a reference field. 

JenniferAcunto_1-1685709280759.png

Bonus Hint: Your reference field does not need to be apart of the same layer, so this will work for you even if the fields are in different layers. 

JenniferAcunto_2-1685709427766.png

 

 

- Jen

View solution in original post

2 Replies
JenniferAcunto
Esri Regular Contributor

Are you trying to display this in an indicator? If so, you don't even need to use Arcade. In your indicator, set your Statistic to Sum and the Field to Cost. Then add a statistic reference. Set the Statistic to Sum and the Field to Feedweight. 

In my example, I've used population for Cost and area for Feedweight. 

JenniferAcunto_0-1685709140056.png

Next, move over to the indicator tab. Remove {value} and {reference} from the indicator and instead add {ratio}. Tip: click on the curly brackets to see all the built in formulas available to you when using a reference field. 

JenniferAcunto_1-1685709280759.png

Bonus Hint: Your reference field does not need to be apart of the same layer, so this will work for you even if the fields are in different layers. 

JenniferAcunto_2-1685709427766.png

 

 

- Jen
AndyMinor2
New Contributor III

Jen,

 

Thanks. That did the trick. I figured I might be over thinking it. 

 

Andy

0 Kudos