Icon

Workflow Demo - options for joining based on column being within range of other column

Demo Options for matching based on non-equal values

Workflow demonstrating some ways to perform a join where part of the join condition is not based on perfect equality. The Joiner node can only join using "equal", so the joiner can be used to perform the part of the join it can produce, and then other standard nodes can be used together to filter those rows that match the remainder of the condition, in a similar way to a Rule Based Row Filter would work. In some cases a Rule Based Row Filter could be used here, but where calculations are required, the Rule nodes are not capable of the required matching, so String Manipulation or Math Formula nodes can be utlised instead.

Another option is to use Math Formula to provide the lower and upper range boundaries for one of the values and then use a Rule-Based Row Filter to keep only those rows where the other Value is within that range


Alternatively, a custom component can be used to provide a "custom condition" utilising a SQL condition compatible with the H2 database

https://hub.knime.com/takbb/spaces/Public/latest/Components/Joiner%20Components/Join%20Custom%20Condition%20-%20indexed

And a further possibility, for greater flexibility and allowing the query to be written using DB Query nodes, components can be used for creating copies of the data in an H2 database:

https://hub.knime.com/takbb/spaces/Public/latest/Components/Joiner%20Components/KNIME%20Table%20Session%20Connector

and

https://hub.knime.com/takbb/spaces/Public/latest/Components/Joiner%20Components/KNIME%20Table%20Connector

Annotations and comments
  • Emulating a "Rule Based Row Filter"... String Manipulation and Math Formula can both perform the same job of flagging "matching" rows, similar to the way Rule Engine would work if it could perform calculations.
  • Calculate lower and upper limits and then use a Rule Based Row Filter to filter only those rows where Value is within range
  • Calculate absolute difference between values and then filter those between 0 and 0.05
  • Using custom condition component to use a SQL query
  • Using "Table Connector" components to create database tables that can then be acted on as if they are a database connection
  • tidy up
  • Write query as if these are database tables
  • takbb-return-left-unmatched
  • T1 to upload
  • T2 to upload
  • exclude tbb row keys
  • left-table-column-list
  • right-table-column-list
  • takbb-array-list
  • takbb-flowvar-create-name
  • Convert to Variables (String Arrays)
  • run the select
  • create indexes
  • Lower table
  • Upper table
  • Get columns to index and minimal columns to select based on condition
  • Join back t1
  • Join back t2
  • tbb_row_key2
  • tbb_row_key1
  • unique-query-id
  • tbb-where-condition
  • delimit column list with \n
  • create uinique h2 db name
  • uppertable name
  • lowertable name
  • complete the where clause
  • Create Indexes as variable
  • Remove disallowed characters
  • Replace spaces and hyhens with underscore
  • Starts with xml?
  • Check first character
  • table-index-list
  • table-column-list
  • Rename to use as variable name
  • Get original list of column names in WAGES file
  • Make them a single String List which can be turned into a String Array
  • regex
  • wildcard
  • pattern
  • takbb-column-header-var-name
  • Create Array Flow Variable "Column Header" as list of columns to keep on output
  • Turn into rows
  • remove existing table. create and write to table
  • table-name
  • lower limit for value 2
  • upper limit for value 2
  • abs (value1 - value2)
  • Flag values within 0.05 of each other
  • Filter rows by difference
  • Filter only within tolerance
  • Filter Value between lower and upper

Nodes

Extensions

Links