Lookup Table

To collect tabulated values in a lookup table with help of keywords, or keyvalues, is a commonly known database operation. The considered node adds this functionality to Sympathy for Data.

Into the node a lookup table and a control table are distributed through the upper and the lower input ports, respectively. The control table must include a number of columns with keyswords/keyvalues for the lookup operation. Each of these control columns has to be paired with a corresponding column in the lookup table. The definition of pairs is controlled from in the configuration GUI of the node.

During execution of the node, the routine steps through the rows of the selected subset of control columns and try to find a match among the all rows in the corresponding subset in the lookup table. If there is a match, the current row in the lookup table, all columns included, is copied to the matching row in the control table. If no match is found an exception will be raised and the execution of the node is stoped, i.e. all rows in the control table subset must be matched.

In the configuration GUI one can choose to treat a defined column pair as event columns. The event columns will typically consist of date or time data when something happend. But in theory can include any other sortable data.

When an event column pair has been defined, each row of in this control table column will be matched with the latest preceding event in the lookup table column. For all other columns the lookup is performed as described above.

class node_lookup_table.LookupTableNode[source]

Collect datavalues in a lookup table with help of a control table. The output includes the collected data togther with content of the control table.

: Table

Table with data stored as a lookup table.

: Table

Table with a number of columns with keywords, or keyvalues.

: Table

Table with the collected data from the lookup table together with content of the lookupee table.

Lookup columns

A list with all the columns in the lookup table. Select a column from the lookup table that should be pair with a column from the lookupee column.

Lookupee columns

A list with all the columns in the control table. Select a column from the lookupee table that should be paired with a column from the lookup table.

Add lookup

Press add lookup to register a pair of the two selected columns among the lookup columns and the lookupee columns.

Remove lookup

Remove the selected pair in the locked columns table.

Locked columns table

Lists all the registered lookup pairs. Use the checkboxes under event column to define a pair as event columns.

Opposite node:


Ref. nodes: