Need help working from home with your Bentley software? We're here to help - click here

How to use the LIKE Operator to filter by label

Applies To 
Product(s): WaterGEMS, WaterCAD, HAMMER, SewerCAD, SewerGEMS, StormCAD, CivilStorm
Version(s): 08.11.05.XX+
Area:  Modeling


How can I set up a query or filter a flextable by label? For example, all pipes that begin with "P-2"

How can I select elements whose label (or other text field) does NOT contain a certain word or letters?


In a Flextable, right click on the Label column heading and choose Filter > Custom. Now create the following filter, either by typing it into the text box, or by double clicking on selection fields:

Label LIKE '%word%'

You may use the % symbol as a wildcard on the either the end of the query, instead of on both sides as shown above, and the utilization of "word" can be any choice of characters you would like.

Note that the single quote is used.

The same syntax can be used with other queries, such as a regular query to select elements in the drawing or to create a selection set.

You can also use "NOT LIKE" in a similar fashion. For example if you want to select all pipes whose label does not contain the phrase P-, then you would use this:

Label NOT LIKE '%P-%'