ArcGIS Dashboard Arcade Data Expression

554
1
03-06-2023 08:41 PM
Labels (1)
M_M
by
New Contributor III

Hello,

I am trying to create an Arcade data expression in a Dashboard. I am trying to calculate an average Trees/Acre for each Stand. 

 

 

 

	var p = 'https://maps.arcgis.com'
	var itemId = 'a8af124e92af44579e3fd07bb59ebb4c'
	var fs = FeatureSetByPortalItem(Portal(p), itemId, 0, ['Stand_No', 'Tally', 'Plot_Configuration', 'Plot_Name', 'Plot_Status', 'Plot_Size'], false)
    
    var Mach = Filter(fs, 'Plot_Size = 0.01 * 10000')
    var Hand = Filter(fs, 'Plot_Size = 0.02 * 2500')
  

return GroupBy(fs,['Stand_No','Plot_Configuration'],[{name: 'TallySum', expression: 'Tally',statistic: 'SUM'},
    {name: 'TCount', expression: '1', statistic: 'COUNT'},{name: 'MachAcres', expression: 'Mach', statistic: 'AVG'},
    {name: 'HandAcres', expression: 'Hand', statistic: 'AVG'}])

 

 

For each individual 'Stand_No':

  • I need to multiply each Tally by either 50 or 100 based on the attributes in the 'Plot_Size' field.
  • Find the average of that new number
  • I'm pretty sure the var in Lines 5 & 6 are incorrect. They are supposed to do the calculations to change the Plot_Size of 0.01 and 0.02 to 100 and 50 respectively to use as a multiplier.  Ex: (0.01 = multiplyer of 100) and (0.02 is  multiplier of 50) and then get the average of those numbers in the GroupedBy expression since I need them by Stand_No

For Example: StandNo = 02331254

  1. There are 3 Plot (Tally) points.
    1. Plot 3:  Tally = 11
    2. Plot 6:  Tally = 11
    3. Plot 9: Tally=12 
  2. The Plot_Size is "0.02" so I need to multiply the Tally numbers by 50.  
    1. 11*50 + 11*50 + 12*50 = 1700
  3. I need to find the average of that new number  (there are 3 plot points in that stand)
    1. 1700/3 = 566.66 Trees per Acre per Stand 

Thank you!

0 Kudos
1 Reply
DavidPike
MVP Frequent Contributor

Isn't it just a common calculation based on divisions of 100 i.e. 100/0.01, 100/0.02, 100/PlotSize ?

0 Kudos