Select to view content in your preferred language

Filter value list in query builder based on previous expressions

03-24-2022 08:41 PM
Status: Open
Labels (1)
New Contributor II

The query builder allows users to pick a field and select a value for that field from the set of unique values already in use. When filtering a large number of records, it would be useful if the set of unique values could be based on previous expressions already set. 

For example, we have a set of 500k service card records in a standalone table arranged by town and street. We are usually interested in filtering to a few records for any given street but there are thousands of streets across the service territory. If we could pick the town first and then pick the street based on only those records for that town, the pick list would typically be reduced to just a few hundred. This would hopefully make the loading process faster and easier for the user to find the street they are interested in.



Query builder - ArcGIS Pro 2.9

Queries or where clauses are used in ArcGIS to select a subset of records. All query expressions use Structured Query Language (SQL) to formulate these search specifications. You will need to use SQL when you construct an expression for many geoprocessing tools, including:

  • Select Layer By Attribute
  • Select
  • Feature Class To Feature Class

You can enter queries in Clause mode, using buttons and choicelists to construct the query in easy-to-understand language. Or, if you are experienced with SQL, you can enter the where clause as text directly in SQL mode. See next link: 


Thank you for submitting this @RogerCarribine We understand the request 🙂

Here would be my example from California road data. I have a feature class with close to 800,000 records and I want to query on some streets that I know are only in LA County. 

We can see that there are 116,517 of 791,140 streets in LA County:


So if I'm building a query where I have already said that I'm only interested in records where County = Los Angeles, then my options for RouteID should be filtered to offer only values that satisfy the first part of the query. In that example below, I shouldn't get all ~800K values from all counties.