Hello KNIMErs,
My task is to compare two tables with hundreds of columns and thousands of rows, however I’m showing dummy data below to keep it simple.
Input tables #1 & #2 have the same structure of columns. Columns cover:
- Index as unique identifier.
- Non-Check column with data.
- Check columns named ‘*Check’. They contain evaluation values ‘0’ (meaning correct entry in appropriate non-Check column) or ‘1’ (meaning incorrect entry in appropriate non-Check column). ‘0’ and ‘1’ are integers (not strings).
- Check and non-Check columns are ‘paired’. It means thet are named in a similar way: ‘Something’ and ‘Something Check’.
Table #1 is a reference table
Table #1 - Reference table | ||||
---|---|---|---|---|
Index | Place | Number | Place Check | Number Check |
aaaa | ewrr | 34636 | 1 | 0 |
bbbb | trye | 457567 | 0 | 0 |
cccc | ryr | 32354 | 1 | 1 |
eeee | gqewrt | 587868 | 0 | 0 |
Table #2 is a table that needs to be compared against reference table
Table #2 - Table to be checked | ||||
---|---|---|---|---|
Index | Place | Number | Place Check | Number Check |
aaaa | wewrr | 34636 | 0 | 0 |
bbbb | trye | 57567 | 0 | 1 |
cccc | ryr | 32354 | 1 | 1 |
dddd | htyhfhh | 2335 | 0 | 0 |
The conditions for creating the outcome table are:
Conditions | ||
---|---|---|
Check value in Table #1 (reference) | Check value in Table #2 (to be checked) |
Action |
0 | 0 | Filter-out index (row) & don’t show in outcome table |
1 | 0 | Filter-out index (row) & don’t show in outcome table |
1 | 1 | Filter-out index (row) & don’t show in outcome table |
0 | 1 | Keep index (row): show index entry, show 1 ‘*Check’ value, show appropriate non-Check entry & remove other entries |
Table #3 is an expected outcome table that contains all entries meeting the above conditions:
Table #3 - Expected outcome table | ||||
---|---|---|---|---|
Index | Place | Number | Place Check | Number Check |
bbbb | 57567 | 1 |
I have tried to utilize suggestions found on this forum, especially this workflow Compare Two Tables – KNIME Community Hub to solve my problem however my results are still far from what I expect.
Could you please suggest some solutions I could apply?
Thank you in advance,
Kaz