?Table Select does not work in Model Builder

3634
15
Jump to solution
12-17-2015 03:34 AM
gilweil
New Contributor II

Hallo,

I'm trying to create a model that uses values from a single table, in order to perform a different calculation for each raster in a file.

Each raster is represented in the table by a row that contains the raster unique name (string), and 2 other fields with the numeric values for the calculation (slope & intercept).

I use "Iterate rasters" to go through the files, and "Table Select" where I select the relevant row for the parameters, by using %Name% (from the iterator) = name (the raster name in the table).

Doesn't work... the model gets stuck in the "Table Select" stage.

Does anyone have any idea why?

I attached python code and image of the model.linear_correction_parameter_from_table_img.png

Thank you!

0 Kudos
1 Solution

Accepted Solutions
LukeSturtevant
Occasional Contributor III

Okay try this:

Add a Calculate Value​ tool in to calculate a valid name for the output table the code would be

"%Name%".split(".")[0]

Then change the output table name to t_%TableName%

View solution in original post

15 Replies
LukeSturtevant
Occasional Contributor III

It would probably be best if you upload the actual model builder tool and not a python export of the tool. Thanks.

0 Kudos
gilweil
New Contributor II

Okay, I added

Thank you

LukeSturtevant
Occasional Contributor III

Is your table that you are selecting from in a local geodatabase or file system?

Have you tried putting single quotes around the %Name% in the selection expression?

0 Kudos
gilweil
New Contributor II

yes,

doesn't seem to help.

The model also added in tbx

gilweil
New Contributor II

the table is from a local geodatabase

0 Kudos
LukeSturtevant
Occasional Contributor III

Then maybe try taking the double quotes off the field name:

name = '%Name%'

0 Kudos
gilweil
New Contributor II

Did not work, sorry ...

0 Kudos
LukeSturtevant
Occasional Contributor III

Could you post a sample of your data? Maybe a raster and the table you are working with? Also could you post a screen shot of the error your are getting?

0 Kudos
gilweil
New Contributor II

Sure, attached.

If I run the model in edit mode, when the model is open, it reaches the tool "Table select" and simply stops ("finished").

In the results panel I get:

<Cannot create output <value: 000210