Hello,
I am having trouble creating an arcade script that will report the number of soil acres by type for a given parcel. I am having two issues with the combined script that calculates the soil area as a percentage and as total acres.
Issue 1:
The intersect function is multiplying the total acres by 2) The purple line below shows how I need to divide the acreage by 2
Issue 2:
I would like to combine (dissolve) similar soil types in my popup. In the example below "Amiret loam, 2-6 percent slopes" occurs in two different polygons. One of them lists 0.27 acres while the other lists 3.74 acres.Is there a way to combine these records so that "Amiret loam, 2-6 percent slopes" is only listed once with a total of 4.01 acres?
*note this second issue is not related to the first!


//list soils in a parcel by type and acreage.
//get the features from the soil layer is overlaped by the parcel layer
var gensoils = Intersects(FeatureSetByName($map,"gensoils"),$feature)
//return the number of soil types wihtin the boundary of the selected parcel
var numsoil = Count(gensoils)
//Set the variable to hold the total amount of area of the soils within the selected soils
var soil_sum = 0;
//begin the results variable to show on popup
var results = 'There are ' + numsoil + ' types(s) of General Soils.' + textFormatting.NewLine
//return the area of each soil (usinf a for loop) within the boundary of the parcel
//add each area to the soil_sum variable
for (var s in gensoils){
soil_sum += Area(Intersection($feature, s),'acre')/2
}
results += "The Total Area of the parcel is " + round(soil_sum,2) + " Acre(s)" + TextFormatting.NewLine
//using another for loop cycle through the soils creating several variables. Append text to the results variable.
for (var g in gensoils){
var soil_area = Area(Intersection($feature, g),'acre')/2
var soil_percent = (soil_area / soil_sum) * 100
var soilname = g.muname
results += TextFormatting.NewLine + soilname + '----' + round(soil_percent,2) + "%";
results += " or " + round(soil_area,2) + " ac(s)";
//results += TextFormatting.NewLine + soilname + '----' + round(soil_percent,2) + "%";
//results += TextFormatting.NewLine + soilname + '----' + round(soil_area,2) + " ac(s)";
//results += TextFormatting.NewLine + " - " + soilname + " - " + round((Area(Intersection($feature, timber),"acres")* ratio),2) + " +/- ac(s)";
}
//return results to the populated popup
return results