?Table Select does not work in Model Builder

3688
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
15 Replies
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%

gilweil
New Contributor II

Thanks a lot

I'll try it on Sunday

0 Kudos
gilweil
New Contributor II

Perfect thanks!

0 Kudos
gilweil
New Contributor II

Now I recognize another problem...

The model (Table select) selects only the first row in the table, the following outputs are empty tables

0 Kudos
LukeSturtevant
Occasional Contributor III

I'm not sure why it would only be running for one table entry for you. I've attached an edited toolbox. This seems to work with the example data you provided just fine on my end.

0 Kudos
gilweil
New Contributor II

Thank you again,

Your solution works great, but I I came across other two problems I have not seen before:

1. The select tool is case sensitive

2.  The model does not overwrite properly the previous outputs

After I treated these specific problems, everything works properly.

0 Kudos