To create an expression

  1. Select the feature classes to apply the expression to and the command that will use the expression.

    For example, in the Model Explorer, click Create Subset for a particular feature class. When you apply the expression, only the data in the selected feature class that matches the conditions of the expression will appear in the model.

  2. In the window that displays, insert the elements that comprise the expression.

    If the Getting Started With Filters page is turned on, buttons representing different expression types are displayed. You can click one of these buttons to insert an expression template.

    Click one of these buttons to start with a sample expression.

    To prevent these startup buttons from displaying each time you create an expression, select Don’t Show At Startup. You can redisplay them later by clicking Getting Started.

    To close the startup page, click Close.

  3. In the expression area, do any of the following to build your expression:
    • If you selected an expression template, click an element in the expression to replace it with a property, value, or operator. See Selecting Property Values from a List for information on viewing and selecting properties.

      Click an element to see a menu of options for replacing or deleting it.

    • Use commands and icons to add elements.

      Use the menus and buttons at the top of the window to insert elements.

    • If you know the names of the properties, values, and operators you want, enter them directly.

      All expressions consist of text you can type.

    An expression can combine operations in many ways. For example, you can calculate the area of a set of buildings and then find buildings that have the StreetName “Elm” and whose area is larger than 2,000 square feet.

  4. In building your expression, you can do any of the following:
    • Evaluate the value of a property. For example, find roads whose NAME property is “Elm.” That expression would look like this one:

      NAME = 'ELM St'

    • Perform a calculation, and then evaluate the result of the calculation. For example, first determine the absolute height of buildings, and then find buildings that are shorter than a value you specify. That expression would look like this one:

      ROOF_HEIGHT + ELEVATION_OFFSET < 32

    • Perform a conversion, and then evaluate the result of the conversion. For example, convert a building property called Purchase_Date from a text string to a date string, and then find parcels purchased before a date you specify. That expression would look like this one:

      ToDate (PURCHASE_DATE, MM/DD/YYYY) AND PURCHASE_DATE < 01/01/2005

      Note: See Using Dates in Expressions for information about date formatting.
    • Create a text expression. For example, during import you can format the Description field for a feature class representing roads. The field can contain the street name, a space, and a suffix (for example, “Portobello Road” or “Fifth Avenue”). That expression would look like this one:

      Concat (NAME, ' ', SUFFIX)

    • Create a numeric expression. For example, you can round off repair costs to the next highest dollar. That expression would look like this one:

      Ceil (REPAIR_COST)

    • Filter by location. For example, you can find all buildings within or touching a circle that you draw on the model.

    For help with any expression element, see Creating Expressions - Reference.

  5. Validate the expression by clicking Validate (at the bottom of the window).

    Validation checks the syntax of the expression only. It does not check whether the values you specified are valid for the data, or whether the results are as expected. If there are validation problems, an error message helps direct you to their solutions.

  6. To reuse your expression later, save it using the Options menu (at the bottom of the window).
  7. To apply your expression, click OK.