I’m trying to automate the selection of polygons from a feature layer based on polygon area. Specifically, I need to select only those polygons whose area is greater than or equal to the median area of all polygons in the layer.
Because this workflow will be repeated with different datasets, the median will change each time and cannot be entered manually.
The screenshot below shows my current ModelBuilder flow. The Value box shows the median area for one of the several input polygon layers, which I want to pass into the Select Layer By Attribute tool.
What I’m unsure about is whether I can pass this median value directly into the tool’s expression parameter, or if I need an intermediate step to construct a full SQL expression string (e.g. "AREA_FIELD" >= median) that can then be passed into the Select Layer By Attribute tool.
Thank you all.
