.. _`Select rows in Table with Table`: .. _`org.sysess.sympathy.data.table.selecttablerowsfromtable`: Select rows in Table with Table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. image:: select_table_rows.svg :width: 48 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 :ref:`appendix_typed_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: :ref:`Select rows in Tables with Table`, :ref:`Select rows in Table`, :ref:`Slice data Table`, :ref:`Filter rows in Table` *Input ports*: :port1: table Table with three columns that defines a set of comparison relations. Each row in the set will set up a comparison relation with a column name, a comparison operator and a constraint value. :port2: table Input Table *Output ports*: :port1: table Table 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. .. automodule:: node_select_table_rows .. class:: SelectTableRowsFromTable Example flows ############# * :download:`SelectRows.syx `