Hello,
I would like to calculate the percentage of properties that are multiple occupancy.
There are 3 Layers required to do this
1) Multiple Occupancy (Points)
2) Addresses (Points)
3) Zones (Polygons)
I have created 2 expressions in the Zones Layer so that in the pop-up they 'count' the number of properties in both point Layers
Can I create another expression in the Zones Layer that will in effect
Multiple Occupancy Count / Address Count * 100
So that I can get a %
This is my arcade but the % returned although does not error is not the correct figure
//count multiple occupancy properties
var hmo = FeatureSetByName($map, 'Houses in Multiple Occupation HMO')
var countHMO = Count(Intersects(hmo, $feature))
return countHMO
//count addresses
var address = FeatureSetByName($map,"CAG OldAbdn Sample")
var countAddress = Count(Intersects(address,$feature))
return countAddress
//calculate % of multiple occupancy
($feature["countHMO"]/$feature["countAddress"])*100
Thank you 🙂
Solved! Go to Solution.
//count multiple occupancy properties
var hmo = FeatureSetByName($map, 'Houses in Multiple Occupation HMO')
var countHMO = Count(Intersects(hmo, $feature))
//return countHMO
//count addresses
var address = FeatureSetByName($map,"CAG OldAbdn Sample")
var countAddress = Count(Intersects(address,$feature))
//return countAddress
//calculate % of multiple occupancy
return (countHMO/countAddress)*100
//count multiple occupancy properties
var hmo = FeatureSetByName($map, 'Houses in Multiple Occupation HMO')
var countHMO = Count(Intersects(hmo, $feature))
//return countHMO
//count addresses
var address = FeatureSetByName($map,"CAG OldAbdn Sample")
var countAddress = Count(Intersects(address,$feature))
//return countAddress
//calculate % of multiple occupancy
return (countHMO/countAddress)*100
Thank you @JohannesLindner , that worked perfectly 🙂
I wonder (if I may ask), is it possible/is there any value adding a 'round' statement?
When you test the expression it returns many decimal places
however I can control the appearance through Configure Pop-up > Configure Attributes. I just wondered if you rounded in advance if that would increase performance?
Thanks
I don't know if it increases the performance (although I guess the effect would be minimal in either way), but you can round:
return Round((countHMO/countAddress)*100, 2)
Cool. Thanks again for your help, much appreciated.