Select to view content in your preferred language

Calculation gone wrong

209
1
Jump to solution
08-28-2025 05:00 AM
ALBJORGUI
Regular Contributor

Hi all, 

 

I have this if in my calculation column but somehow it is throwing me an error 

The syntax I'm using is:

if(${true_bearing} >= 337.5 or ${true_bearing} < 22.5, 'N'), if(${true_bearing} >= 22.5 and ${true_bearing} < 67.5, 'NE'), if(${true_bearing} >= 67.5 and ${true_bearing} < 112.5, 'E'), if(${true_bearing} >= 112.5 and ${true_bearing} < 157.5, 'SE'), if(${true_bearing} >= 157.5 and ${true_bearing} < 202.5, 'S'), if(${true_bearing} >= 202.5 and ${true_bearing} < 247.5, 'SW'), if(${true_bearing} >= 247.5 and ${true_bearing} < 292.5, 'W','NW')

 

Any help will be much appreciated 🙂

0 Kudos
1 Solution

Accepted Solutions
CodyPatterson
MVP Regular Contributor

Hey @ALBJORGUI 

I think your syntax for your if statements may be incorrect, as these posts outline:

https://community.esri.com/t5/arcgis-survey123-questions/survey123-calculation-multiple-if-parameter...

https://community.esri.com/t5/arcgis-survey123-questions/how-to-create-a-nested-quot-if-quot-stateme...

Try something like this here:

if(${true_bearing} >= 337.5 or ${true_bearing} < 22.5, 'N', if(${true_bearing} >= 22.5 and ${true_bearing} < 67.5, 'NE', if(${true_bearing} >= 67.5 and ${true_bearing} < 112.5, 'E', if(${true_bearing} >= 112.5 and ${true_bearing} < 157.5, 'SE', if(${true_bearing} >= 157.5 and ${true_bearing} < 202.5, 'S', if(${true_bearing} >= 202.5 and ${true_bearing} < 247.5, 'SW', if(${true_bearing} >= 247.5 and ${true_bearing} < 292.5, 'W', 'NW')))))))

Cody

View solution in original post

1 Reply
CodyPatterson
MVP Regular Contributor

Hey @ALBJORGUI 

I think your syntax for your if statements may be incorrect, as these posts outline:

https://community.esri.com/t5/arcgis-survey123-questions/survey123-calculation-multiple-if-parameter...

https://community.esri.com/t5/arcgis-survey123-questions/how-to-create-a-nested-quot-if-quot-stateme...

Try something like this here:

if(${true_bearing} >= 337.5 or ${true_bearing} < 22.5, 'N', if(${true_bearing} >= 22.5 and ${true_bearing} < 67.5, 'NE', if(${true_bearing} >= 67.5 and ${true_bearing} < 112.5, 'E', if(${true_bearing} >= 112.5 and ${true_bearing} < 157.5, 'SE', if(${true_bearing} >= 157.5 and ${true_bearing} < 202.5, 'S', if(${true_bearing} >= 202.5 and ${true_bearing} < 247.5, 'SW', if(${true_bearing} >= 247.5 and ${true_bearing} < 292.5, 'W', 'NW')))))))

Cody