Post

3 followers Follow
0
Avatar

Format for logical connectives (AND, OR, etc)?

Greetings,

I am building a simple if-then expression that checks if at least one of two roadway type columns includes the type "COUNTY" to then assign a "YES" or "NO" value to another column.  The formula I have for this new column is:

"YES" if (ALT_NAM1="COUNTY" OR ALT_NAM2="COUNTY") else "NO"

Cartographica shows "Syntax error in formula" in the "Set formula" dialog box. I am unable to find guidance in the program's documentation. I would be grateful for your advice on building this expression.  Thanks,

Antonio

Antonio Rosell Answered

Please sign in to leave a comment.

1 comment

0
Avatar

Sorry for the delay in this, hopefully this will be of use to you or somebody else at this point.

 

The problem with the syntax in the above formula is the use of "=", which is the assignment function, as opposed to "==" which is for comparisons.   So, if you use:

    "YES" if (ALT_NAM1=="COUNTY" OR ALT_NAM2=="COUNTY") else "NO"

You won't get the syntax error.

 

Gaige B Paulsen 0 votes
Comment actions Permalink