3

I am trying to select the smallest Directionality value based on a selection of two Workingspace values:

enter image description here

In the above picture, there are two "Jeffery's" selected, I want to then select the Jeffery with Directionality 2 (I.E. the smaller one) without using = 2. I know there is a max/ min SQL expression:

DIRECTIONALITY = (SELECT MIN( DIRECTIONALITY) FROM TableName)

But this returns no values when choosing the select from current selection method. HOWEVER, if I create a new selection, this SQL does return a selection of 1 (it selects the row where Directionality is 1).

Is there a way to tell ArcMap to select the smallest value of a previous selection based on a different field? Specifically in Model Builder.

Inactivated Account
19.1k5 gold badges72 silver badges117 bronze badges
asked Jul 11, 2019 at 13:54

1 Answer 1

2

Your current SQL expression does not return anything from the current selection because (SELECT MIN( DIRECTIONALITY) FROM TableName) always evaluates to 1, which is indeed the minimum value for the whole table. You need to take the minimum value from just the rows that meet the condition WORKINGSPACE = 'Jeffery' and you can do this in one selection instead of two. The following expression (which I am sure can be rewritten in a cleaner way) worked for me:

SELECT * FROM TableName WHERE DIRECTIONALITY = (SELECT MIN(DIRECTIONALITY) FROM TableName WHERE WORKINGSPACE = 'Jeffery')
answered Jul 11, 2019 at 14:44
2
  • Thanks so much that worked!! Commented Jul 11, 2019 at 14:59
  • @Sarah Glad to help. If it solved your question, you can mark this answer as the accepted answer. Commented Jul 11, 2019 at 15:09

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.