Select rows in Tables with Table

../../../../../_images/select_table_rows.svg

Select rows in Table by using an additional Table with predefined comparison relations. The output Table has the selected rows from incoming Table with order preserved. The number of rows in the output is therefore always less than or equal to the number of rows in the input. The number of columns is the same.

The selection Table should have at least three columns that define a set of constraints. Each row will set up one constraint with a column name, a comparison operator and a constraint value.

The following operators are recognized by the node, either in their string form (e.g. equal) or their symbolic form (e.g. ==):

  • equal (==)
  • less than (<)
  • less than or equal (<=)
  • greater than (>)
  • greater than or equal (>=)
  • not equal (!=)

Each constraint will be applied in turn. The results per constraint are then combined using the selected reduction method. If set to all (the default) all the constraint needs to be True for a row to be included in the output. If set to any it is enough any single constraint is True. When the configuration table only contains a single constraint this option has no effect. Unless Evaluate values as code is used, each constraint value will be read as a value of the same type as the column it is compared to. For information about how to enter text, see Input typed values as text.

Rows where any of the selected columns are masked are never included in the output.

Older versions of this node always evaluated the constraint values as Python code. This behavior is no longer neither encouraged nor default but if you need it, it can still be enabled by checking the checkbox Evaluate values as code.

Ref. nodes:Select rows in Table with Table, Select rows in Table, Slice data Table, Filter rows in Table
Input ports:
port1:

table

Selection

port2:

[table]

Input Tables

Output ports:
port1:

[table]

Tables with rows in Selection

Configuration:
Column with column names (column)
Select column in the selection Table that includes listed column names.
Column with comparison operators (relation)
Select column in the selection Table that includes listed comparison operators.
Column with constraint values (constraint)
Select column in the selection Table that includes listed constraint values.
Reduction: (reduction)
If there are multiple selection criteria, do ALL of them need to be fulfilled for a data row to be selected, or is it enough that ANY single criterion is fulfilled?
Evaluate values as code (eval)
When checked the values column will be evaluated as Python code. When unchecked the values column is used as is.
class node_select_table_rows.SelectTablesRowsFromTable[source]