I have a table with five fields for sampling records and a sixth field for a mean/average value to be calculated in.
I have used the Arcade command 'Average' within 'Field Calculator', but find it does not calculate a correct value when 0 values are recorded within some fields.
Average($feature.fld0,$feature.fld1,$feature.fld2,$feature.fld3,$feature.fld4)
Average(1,2,3,0,0) should equal (1+2+3) / 3 = 2, but the value I am getting is (1+2+3+0+0) / 5 = 1.2
What would be the expression to calculate the correct average value when some fields have 0 values (ie. exclude fields with a 0 value from the calculation)?