Select - Numbers: Search

The Search template appears in template list when a numeric field of type float32, float64, int8, int16, int32, int64uint8, uint16, uint32, or uint6 has been picked in the Select pane.  The template selects based on numeric values compared to the given value.

 

Search

Select by comparing the source field value using the given Condition to the given value or values,  which can be values from a field, a specified value, or the result of an expression that evaluates to a numeric data type.

 

Condition options:

 

  • between - Select records with values between the specified At least and At most values, inclusive.
  • equal (=) - Select records with values equal to the specified value.
  • greater (>) - Select records with values greater than the specified value.
  • greater or equal (>=) - Select records with values greater than or equal to the specified value.
  • less (<) - Select records with values less than the specified value.
  • less or equal (<=) - Select records with values less than or equal to the specified value.
  • not equal (<>) - Select records with values not equal to the specified value.

 

If we would like to select records that are logical NOT variations of the above, for example not between, select on the basis of one of the above and press Ctrl-I or Edit - Select Inverse to invert the selection.   Selecting using between and then pressing Ctrl-I is the equivalent of "not between" the given values.

 

The Round box allows automatic rounding of the source field number before comparing to the specified value:

 

  • none -  No rounding.
  • down (floor) - Round down to the next lowest Round to position value. 400.7 would round down to 400.   -400.7 would round down to -401 (which is a smaller amount, and thus "down," from 400).
  • to nearest (round) - Round up or down to the nearest Round to position value. When rounding to 1, a value of 400.5 or greater fraction will get rounded up to 401 while fractional parts less than .5 will get rounded down to 400.
  • to zero (trunc) - Rounding towards zero: Equivalent to rounding down for positive numbers, and rounding up for negative numbers.
  • up (ceil) - Round up to the next highest Round to position value. 400.2 would round up to 401.   -400.2 would round up to -400 (which is a large amount, and thus "up," from 400).

 

 

Launch the template by choosing a numeric field in the Select pane and then double-clicking the Search template.  When the template launches we can specify options.

 

 

Search : between

Select records with values between the At least and At most values, inclusive.  The At least and At most values can be specified b entering a value, by choosing a field or by choosing Expression and using an SQL expression.

 

We start with a table with a single Series field of type float64.   We have used the Layers pane to hide the mfd_id field, for a simpler illustration.

 

 

With the focus on the table window, in the Select pane we choose the Series field and then we double-click the Search template to launch it.

 

 

In the Search template we choose between as the Condition option.  For the At least value we enter 5 and for the At most value we enter 7.  

 

We leave the Round value set to the default none, meaning no rounding of the Series values before they are compared to the At least and the At most values.

 

For the Action, we use the default replace selection option.

 

Press Select.  

 

 

Records with a Series value between 5 and 7, inclusive, are selected.

 

In the example above, we entered literal numbers into the At least and the At most boxes.   We could have, however, chosen another field or written an SQL expression for either box, as shown in the following example.

 

We start with a table with two fields, a Numbers field and a Fractions field, both of type float64.

 

 

With the focus on the table window, in the Select pane we choose the Numbers field and then we double-click the Search template to launch it.

 

 

In the Search template we choose between as the Condition option.    From the pull down menu in the At least value box we choose the Fractions field.   In the At most box we choose Value and enter 12468.   We will select those records where for each record the value in the Numbers field is at least the value in the Fractions field and at most the number 12468.

 

For either the At least or the At most parameters, we can choose a field, enter a value, or choose Expression and enter an SQL expression.

 

We leave the Round value set to the default none, meaning no rounding of the Numbers values before they are compared to the At least and the At most values.

 

For the Action, we use the default replace selection option.

 

Press Select.  

 

 

The template selects all records where the Numbers value is at least the Fractions value and at most the number 12468.

 

Note that in the fourth record the value of 12468 is equal to the upper bound specified so for that record Numbers is considered Between the lower bound of the value in Fractions and the specified upper bound of 12468.

 

Search : equal (=)

Select records with values equal to the given value.

 

Search : greater (>)

Select records with values greater than the given value.

 

We start with a table that gives populations for provinces in Mexico.  It has two fields, a State field that is a text nvarchar field and a Population field that is integer type int32.  We have used the Layers pane to hide the mfd_id field, for a simpler illustration.

 

 

With the focus on the table window, in the Select pane we choose the Population field and then we double-click the Search template to launch it.

 

 

In the Search template, for Condition, we choose greater (>), and for the Value we enter 4000000.

 

For the Round option, we leave the default none setting, to not round the Numbers values before making the greater than comparison.

 

For the Action, we use the default replace selection option.

 

Press Select.  

 

 

The template selects all records for which the Population value is greater than 4000000.

 

In the example above, we entered a literal number into the Value box.   We could have, however, chosen another field or written an SQL expression for the Value, as shown in the following example.

 

We start with a table with two fields, a Numbers field and a Misc Numbers field, both of type float64.

 

 

With the focus on the table window, in the Select pane we choose the Numbers field and then we double-click the Search template to launch it.

 

 

In the Search template, for Condition, we choose greater (>), and for the Value from the pull down menu we choose the Misc Numbers field.   

 

If we wanted to compare the Numbers field to a fixed value, we could have chosen Value and then entered a true or false value.  Or, if we preferred to compare to the result of an SQL expression, we could have chosen Expression and then entered an SQL expression.

 

For the Round option, we leave the default none setting, to not round the Numbers values before making the greater than comparison.

 

For the Action, we use the default replace selection option.

 

Press Select.  

 

 

Records where the Numbers value is greater than the Misc Numbers value are selected.   Note the fifth record is not selected, since being equal is not the same as being greater than.

 

Search : greater or equal (>=)

Select records with values greater than or equal to the given value.

 

We start with a table with two fields, a Numbers field and a Misc Numbers field, both of type float64.  We have used the Layers pane to hide the mfd_id field, for a simpler illustration.

 

 

With the focus on the table window, in the Select pane we choose the Numbers field and then we double-click the Search template to launch it.

 

 

In the Search template we choose Numbers as the Field option.    

 

For Condition, we choose greater or equal (>=), and for the Value from the pull down menu we choose the Misc Numbers field.   If we wanted to compare the Numbers field to a fixed value, we could have chosen Value and then entered a true or false value.  Or, if we preferred to compare to the result of an SQL expression, we could have chosen Expression and then entered an SQL expression.

 

For the Round option, we leave the default none setting, to not round the Numbers values before making the greater than or equal comparison.

 

For the Action, we use the default replace selection option.

 

Press Select.  

 

 

Records where the Numbers value is greater than or equal to the Misc Numbers value are selected.  This is the same result as using the greater (>) condition, except that now the fifth record is selected, since both values are equal.

 

Search : less (<)

Select records with values less than the given value.

 

We start with a table that gives populations for provinces in Mexico.  It has two fields, a State field that is a text nvarchar field and a Population field that is integer type int32.   We have used the Layers pane to hide the mfd_id field, for a simpler illustration.

 

 

With the focus on the table window, in the Select pane we choose the Population field and then we double-click the Search template to launch it.

 

 

In the Search template, for Condition, we choose less (<), and for the Value we enter 5000000.

 

For the Round option, we leave the default none setting, to not round the Numbers values before making the greater than comparison.

 

For the Action, we use the default replace selection option.

 

Press Select.  

 

 

The template selects all records for which the Population value is less than 5000000.

 

In the example above, we entered a literal number into the Value box.   We could have, however, chosen another field or written an SQL expression for the Value, as shown in the following example.

 

We start with a table with two fields, a Numbers field and a Misc Numbers field, both of type float64.

 

 

With the focus on the table window, in the Select pane we choose the Numbers field and then we double-click the Search template to launch it.

 

 

In the Search template we choose Numbers as the Field option.    

 

For Condition, we choose less (<), and for the Value from the pull down menu we choose the Misc Numbers field.   If we wanted to compare the Numbers field to a fixed value, we could have chosen Value and then entered a true or false value.  Or, if we preferred to compare to the result of an SQL expression, we could have chosen Expression and then entered an SQL expression.

 

For the Round option, we leave the default none setting, to not round the Numbers values before making the less than comparison.

 

For the Action, we use the default replace selection option.

 

Press Select.  

 

 

Records where the Numbers value is less than the Misc Numbers value are selected.   Note the fifth record is not selected, since being equal is not the same as being less than.

 

Search : less or equal (<=)

Select records with values less than or equal to the given value.

 

We start with a table with two fields, a Numbers field and a Misc Numbers field, both of type float64.   We have used the Layers pane to hide the mfd_id field, for a simpler illustration.

 

 

With the focus on the table window, in the Select pane we choose the Numbers field and then we double-click the Search template to launch it.

 

 

In the Search template we choose Numbers as the Field option.    

 

For Condition, we choose less or equal (>=), and for the Value from the pull down menu we choose the Misc Numbers field.   If we wanted to compare the Numbers field to a fixed value, we could have chosen Value and then entered a true or false value.  Or, if we preferred to compare to the result of an SQL expression, we could have chosen Expression and then entered an SQL expression.

 

For the Round option, we leave the default none setting, to not round the Numbers values before making the less than or equal comparison.

 

For the Action, we use the default replace selection option.

 

Press Select.  

 

 

Records where the Numbers value is less than or equal to the Misc Numbers value are selected.  This is the same result as using the less (<) condition, except that now the fifth record is selected, since both values are equal.

 

Search : not equal (<>)

Select records with values not equal to the given value.

 

 

See Also

Select - Numbers

 

Select - Numbers: Expression

 

Select - Numbers: Null

 

Select Reference

 

Select - Expression

 

Example: Flooded Roads - We consider a hypothetical case of a 10 meter rise in sea level in the San Francisco Bay area, and we find what highways and major roads would be flooded by such a rise.   The example uses both raster and vector data sets, combines a number of techniques and uses the Contour, Buffer, Merge, and Clip transform templates.