Hello all
I have two column like below:
table1:
name |
length |
a |
1 |
b |
2 |
c |
3 |
d |
4 |
e |
5 |
f |
6 |
table2
I need to know if names of table2 are available in table one, and make a table like this
my favorite table
name |
length |
availability |
a |
1 |
False |
b |
2 |
True |
c |
3 |
False |
d |
4 |
True |
e |
5 |
False |
f |
6 |
True |
any answer will appreciated.
Thank you in advance
Hi Ahmadiut,
In order to solve your problem I would use a Reference Column Splitter node with table 1 connected to the first input port, table 2 as reference connected in the second input port. Then using 2 Constant Value Column nodes (one for each output port) you can add the "availability" column with a constant "True" or "False" value depending if it is connected to the first or second output port. Finally you can use a Concatenate and Sorter node to concatenate the 2 outputs and re-sort them.
Probably there are more elegant solutions but this is the first that came to my mind.
I hope it helps.
Gio
Alternatively
1. use a joiner node with table 1 as top input and table 2 as bottom input
2. left outer join on name
3. column selection tab uncheck the "Remove joining columns from the bottom input ('right' table)"
then you'll have a name (#2) column from 2nd table with missing values, and if want to find out which is available and which is not, row filter this column for missing values
Thank you so much gcincilla and David,