ModelBuilder syntax error in ArcPro

248
3
08-02-2018 03:13 PM
Highlighted
New Contributor

ModelBuilder syntax error in ArcPro

I am using the tutorial here: Prepare Ecological Land Unit data for analysis—Identify an Ecological Niche for African Buffalo | Ar... 

and am on step 7 using ModelBuilder to establish con statements and values. I keep getting a syntax error although I am following the directions exactly.

Does anyone have an idea what I'm doing wrong? 

~Natasha

Tags (2)
Reply
0 Kudos
3 Replies
Highlighted
MVP Esteemed Contributor

It looks the same, but check for a space after the last %.

In any event, if the query is wrong and you had no other errors in previous steps.  You may wish to backtrack. save your work, reboot and try again. 

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor
Reply
0 Kudos
Highlighted
MVP Frequent Contributor

I'm not sure how their tutorial could have ever run, I'm guessing it was not properly stress tested before it was released?

If you think about it the con tool is using a SQL expression to identify what is True or False. The output of the Iterator is simply a value from the table, so it makes no sense! As the input to the iterator AND the Con tool is the same raster then it has to be an Integer raster as they are the only format of raster that is allowed to have an attribute table.

So how do you convert a value into a valid SQL expression that can be a valid parameter for the where clause of the Con tool? You would use the model only tool Calculate Value and construct the expression, making sure it's output is of data type SQL Expression.

So the output of my iterator, RasterVal is a precondition to the Calculate Value tool whose output is the input to the Con Where clause parameter. So the model should be:

Note expression is enclosed in double quotes.

This worked on ArcPro 2.2.4

Reply
0 Kudos