1

I'm running ArcGIS 10.3 on Windows 10.

I need to find all the Block names and identify the record with the largest area. Then I need to calculate the Species across to the last field. However, it doesn't seem to do anything after the first iteration.

To do this I set up a basic iteration on field values, using unique values in the Blocks feature class below (which has the same Block names as the input feature class for the "Make Feature Layer" tool), selecting the first BlockId in the Feature Layer and then executing a nested subset selection (SUM_SourceHa=(SELECT MAX( SUM_SourceHa) FROM TestSource_Dissolve)) on the records for that Block to find the instance with the maximum area. Then I simply use that selection to calculate the Species value across to the SpeciesSelect field. The problem is that it calculates this for the first iteration, but not thereafter.

I suspect it's holding on to the first selection somehow and when it runs the second time, nothing is selected when it's looking for Block A2 inside the initial selection for A1 and then it gives me the green error saying that it's empty when it tries to select the maximum. As you can see, I've even tried to add the "Clear Selection" operation, but it's got no affect. Strictly speaking I shouldn't have to do that as it's a new selection on each iteration, but I thought it won't hurt.

What am I missing?

enter image description here

enter image description here

[1]: https://i.sstatic.net/F0934.png

1 Answer 1

0

Your subselect is not honouring the selection you imposed based upon block number, so the maximum value is always 21.767.

I would suggest the following workflow. First create a separate summary table summarizing by block ID and MAX Sum_SourceHA as shown below. Do not be tempted to include this in the model as it only needs to be constructed once.

Summary table

Then use this model:

Model

The expression in the single select tool is:

block = '%blockid%' AND SUM_SourceHA = %maxvalue%

The result is:

results

Note the selection existing on the final loop, so you may want clear that or simply ignore it?

2
  • Hi hornbydd, I actually thought of this route myself, but I wanted to keep it nice a tidy. I still don't understand why the subset selection isn't picking up the previous selection. However, I tried your suggestion and it initially had some issues with finding the matching area values with too many decimals (they didn't match exactly), so I reduced it to 10 decimals. Seems to be working now. I'll just hold off with accepting this as the answer to see whether someone can tell me why the subset selection isn't doing the trick.
    – MierMoto
    May 27, 2021 at 2:41
  • @Vince is a database guru he might be able to suggest why the subselect is not recognising an existing selection? I'm going to guess its because of how SQL works and it simply does not recognise a selection on a FeatureLayer?
    – Hornbydd
    May 27, 2021 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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