I have a geodatabase with several hundred rasters. I would like to make an iteration and carry out zonal statistics for every raster in the geodatabase. The problem is, that I don't want to iterate all the rasters at once, I would like to be able to stop iteration after every 12 rasters.


I tried to use Calculate Value to Stop the model after every 12 rasters so if the numeration starts from 0, the first break would be at the raster called t11

calculate value query

But it seems that Calculate Value doesn't work for string values. How is it possible to stop iterating after every 12 rasters?


Your Calculate Value tool is the source of your problems. I have spoofed up a simple model, shown below, note that the Name variable is a precondition and not a direct input.


Below is the Calculate Value tool correctly shown. Note the following:

  • In the expression you call the function, you were not doing that
  • In the expression you use inline substitution ensuring it was in quotes, you were not doing that.
  • The return logic is opposite to what you had
  • The return value is a boolean, you had accepted the default.

Calculate Value Tool

So in this example the model stops when it hits the file name LT41370441989028XXX02_B6.TIF.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.