Friday, 3 August 2018

Using MAX in SQL Expression of ArcGIS ModelBuilder?


I am trying to use a SQL expression in order to select values that are >= 25% of its max value in that column. For instance, VALUE >= MAX(VALUE)*0.25, and those will ultimately be the selected points it pulls out. Is there syntax to make that happen, or am I going to need to create a new column and use field calculator on it. Biggest issue with that is I will have to do this for about 250 files. I'm also trying to create this in modelbuilder.


When I try it as above it just returns there is an error with the expression.



Answer



The technique I use to do this in ModelBuilder is to:




  1. Run Summary Statistics (Analysis) to write the MAX value into its output table

  2. Use Get Field Value (ModelBuilder) to read the first row of the table just created which holds that MAX value


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...