0 ×

Trim Table

Vernalis custom KNIME nodes package version 1.30.1.v202103301200 by Vernalis (R&D), UK

This node trims rows of missing values from the start and end of the table, according to the settings. Consider the following table:
Col1 Col2 Col3
Row0 ? Foo ?
Row1 Hello Foo Bah
Row2 ? Foo ?
Row3 World ? Bah
Row4 ? Foo ?
Row5 ? ? ?
Selecting All columns in the node dialog, with both trim start and trim end options selected, and the trim behaviour set as 'Require All' will result in only Row1 being kept:
Col1 Col2 Col3
Row1 Hello Foo Bah

Only selecting the trim start option would result in Row1 to the end of the table being kept:
Col1 Col2 Col3
Row1 Hello Foo Bah
Row2 ? Foo ?
Row3 World ? Bah
Row4 ? Foo ?
Row5 ? ? ?
and only selecting trim end would result in Row0 and Row1 being kept:
Col1 Col2 Col3
Row0 ? Foo ?
Row1 Hello Foo Bah

Changing the trim behaviour to 'Require Any', with both trim start and trim end options selected, will result in Row0 to Row4 being kept:
Col1 Col2 Col3
Row0 ? Foo ?
Row1 Hello Foo Bah
Row2 ? Foo ?
Row3 World ? Bah
Row4 ? Foo ?

Selecting only Col1, with either trim behaviour selected (they are degenerate for a single column), will result in Row1 to Row3 being kept:
Col1 Col2 Col3
Row1 Hello Foo Bah
Row2 ? Foo ?
Row3 World ? Bah
NB - The missing value in Row2 is retained, as there is a row which passes the filter later in the table (Row3)
Node execution follows the following order in node progress
  1. Looking for first include row (Only if 'Trim Start' is selected) - The node is working from the start of the table, looking for the first row to include in the output
  2. Adding rows to table - The first row to be included has been found, and rows are now being added to the output table. This continues until the end of the table if 'Trim End' is not selected, or until a row failing the include filter is found
  3. Checking for further matching rows at end of table (Only if 'Trim End' is selected) - The node is now looking ahead in the table to see if any more rows should be added to the table after the current row, which failed the include filter. Progress per row is now 1/2 what it was above, as each row could need to be processed twice. Rows are added to a temporary table
  4. Merging temporary tables (Only if 'Trim End' is selected, and the previous stage found any further rows to add to the table) - The node is now adding the rows required to be kept from the temporary table to the output table. The remaining progress is divided equally amongst the actual number of rows to be added to the output from the temporary table

This node was developed by Vernalis Research (Cambridge, UK) . For feedback and more information, please contact knime@vernalis.com

Options

Column selector
Select the columns to be used for filtering
Trim Start
Should columns at the start of the table be removed if they fail the 'Trim Behaviour' setting?
Trim End
Should columns at the end of the table be removed if they fail the 'Trim Behaviour' setting?
Trim Behaviour
'Require All' only keeps rows at the ends of the table in which all the selected columns are not missing values. 'Require Any' is a softer filter, keeping a row if any of the selected columns are non-missing.

Input Ports

Icon
A table to filter

Output Ports

Icon
The filtered input table

Best Friends (Incoming)

Best Friends (Outgoing)

Installation

To use this node in KNIME, install Vernalis KNIME Nodes from the following update site:

KNIME 4.3

A zipped version of the software site can be downloaded here.

You don't know what to do with this link? Read our NodePit Product and Node Installation Guide that explains you in detail how to install nodes to your KNIME Analytics Platform.

Wait a sec! You want to explore and install nodes even faster? We highly recommend our NodePit for KNIME extension for your KNIME Analytics Platform. Browse NodePit from within KNIME, install nodes with just one click and share your workflows with NodePit Space.

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.