Point Shape - select by atributes max value and 20% lower

1033
4
Jump to solution
12-14-2016 01:37 AM
JohnnyJohansson
New Contributor III

How do I state the SQL querry to select points by atributes by max value and 20% lower?

I have the Shapefile in a geodatabase. 

I'm going to create a workflow in Model builder later but I need to prove that this analasys corresponds to the realworld manualy first. So if thers anything special to do to use the same function in model builder I would like to know that too.

Arcgis 10.4. - spatial analasys, 3D, ++ extention pack.

I'm constructing an analasys workflow that indicates separate trees and corresponding hight to each tree.

0 Kudos
1 Solution

Accepted Solutions
FC_Basson
MVP Regular Contributor

You can use a subquery:

GRID_CODE >= ( (SELECT MAX( GRID_CODE ) FROM new_shapefile3) * 0.8)‍‍

This will return all the values that are larger than 80% of the max, so the top 20%.

View solution in original post

4 Replies
FC_Basson
MVP Regular Contributor

You can use a subquery:

GRID_CODE >= ( (SELECT MAX( GRID_CODE ) FROM new_shapefile3) * 0.8)‍‍

This will return all the values that are larger than 80% of the max, so the top 20%.

JohnnyJohansson
New Contributor III

Thats works fine if I have exported the shapefile to a database, but if I have a created feture class indide a database the same querry selects everything, What I'm I doing wrong here?

0 Kudos
JohnnyJohansson
New Contributor III

Well.... I dont see what I'm doing wrong here.... with this code I just selects everything...

gridcode >= ((SELECT MAX( GRIDCODE ) FROM PEAK_LO_111) ) *0.8

0 Kudos
FC_Basson
MVP Regular Contributor

The caps of the field name in the statement needs to be consistent eg SELECT MAX(gridcode)

0 Kudos