Solved! Go to Solution.
Hi there,
I am new to model builder and am stuck on what is a seemingly simple task..
I'd like the model to select the feature with the maximum value so that I can export and use it as my starting point for least cost path iterations.
In my case, I just need the feature with the highest numerical value for Near_Dist to be selected.
I have looked into the sort tool (sort by descending then select first row), using code blocks and search cursors for calculate field or the select tool, building expressions in select by attributes using somethine like: "Near_Dist=(SELECT MAX(Near_Dist) FROM TableName)"
But I have been unsuccessful so I am resorting to this forum. Please let me know if you have encountered this before / have any ideas on what I could do.
Thanks so much in advance!
Hi there,
I am new to model builder and am stuck on what is a seemingly simple task..
I'd like the model to select the feature with the maximum value so that I can export and use it as my starting point for least cost path iterations.
In my case, I just need the feature with the highest numerical value for Near_Dist to be selected.
I have looked into the sort tool (sort by descending then select first row), using code blocks and search cursors for calculate field or the select tool, building expressions in select by attributes using somethine like: "Near_Dist=(SELECT MAX(Near_Dist) FROM TableName)"
But I have been unsuccessful so I am resorting to this forum. Please let me know if you have encountered this before / have any ideas on what I could do.
Thanks so much in advance!
Thanks so much for those ideas.
I've used inline variables once before and then was when I was doing an iterator tutorial.
I'm not sure how I would read the value in the output to a variable. I re-labelled the output of summary stats to %Value%
and then did a select by attributes with your SQL expression [Near_Dist >= %Value% - .0000001] but I got invalid SQL errors.
Is there a step I am missing?
Thanks again!!