I am trying to create a custom symbology in Portal using two different fields and a number of if statement requirements. The feature layer contains fields on Pressure and Pipe Size. I want a custom symbology which has certain sizes of pipe linked to certain pressure. For example, having Medium pressure pipe with a size of 6 - 10".
The problem is the below code only shows three out of the five created categories. I've tried coding it up with nested if statements instead of && but ran into the same issues. It seems no matter how I end up writing it, one or more categories won't show up..and which categories don't show up isn't consistent!
var size = $feature.NOMINALPIPESIZE;
var pressure = $feature.PRESSURECODE;
if(size < 10 && pressure <= 2){
return 'Low Pressure, Under 10"'}
else if( 10 <= size <= 12 && pressure <= 2){
return 'Low Pressure, 10-12"'}
else if(size >= 13 && pressure <= 2){
return 'Low Pressure, 13"+'}
else if(size < 6 && 5 <= pressure <= 25){
return 'Medium Pressure, Under 6"'}
else if(6>= size <= 10 && 5 <= pressure <= 25){
return 'Medium Pressure, 6-10"'}
else if( size >= 2 && 60 >= pressure <= 27){
return 'Intermediate Pressure, 2 and under'}
else {
return 'Unknown' }
Xander Bakker, I'm tagging you on this question as you've helped me out a lot with previous questions and your blog posts have helped answer numerous other questions that didn't make their way to GeoNet.