Matching and comparing

Hello!! Knime expert
I am facing following issue, please guide to resolve…

Input:
table-1

combine string 789 790 791 792 793 794 795
1 0 0 0 Upward downward 0 upward
2 Upward 0 Upward 0 downward upward 0
3 0 0 downward downward downward upward 0
4 0 0 upward downward 0 upward downward
5 Downward Upward 0 0 0 upward downward
6 0 Upward 0 0 0 0 0

Table-2

combine string 789 790 791 792 793 794 795
1 0 0 0 Upward downward 0 upward
2 Upward 0 Upward 0 upward downward 0
3 0 0 upward downward downward upward 0
4 0 0 upward upward 0 upward upward
5 upward Upward 0 0 0 upward downward
6 0 0 0 0 0 0 0

Requirement:

Compare Table-1 with Table-2
And give Output As “True” if cell are matching, and “false” where cells are not matching

Output Required:

combine string 789 790 791 792 793 794 795
1 TRUE TRUE TRUE TRUE TRUE TRUE TRUE
2 TRUE TRUE TRUE TRUE FALSE FALSE TRUE
3 TRUE TRUE FALSE TRUE TRUE TRUE TRUE
4 TRUE TRUE TRUE FALSE TRUE TRUE FALSE
5 FALSE TRUE TRUE TRUE TRUE TRUE TRUE
6 TRUE FALSE TRUE TRUE TRUE TRUE TRUE

@armingrudd @ipazin @HansS @SimonS

Please Guide.

Hi @ravi13,

I would start with concatenate followed by group by.
Unfortunately you have to loop afterwards in order to transform 1/2 to false/true. Is there a way without loop?

see here:

Hope this helps, Tommy

you can join these two table base on combine string and then use rule engine node and compare two column
for example:
$789$ = $789 (#1)$ => TRUE
FALSE

And you can use column list loop start to avoid writing rules for each column

2 Likes

Hi there @ravi13,

check here how you can deal with this:

Please refrain from mentioning specific people who have not been involved in this or any other discussion around this topic. Thank you!

Br,
Ivan

4 Likes

Ok!!

@ipazin will take care from next time.

1 Like

Hi!! @Vossoughi_h

Firstly sorry for late reply.

I am facing following issue…
As i have done transpose, I am not able to use rule engine node…because Column is not define whether it’s String or Number

Please guise.

Hi @ravi13,

you can use Column Auto Type Cast which will probably convert all column into string in your case. Then you can either work with strings either use String To Number node.

Br,
Ivan

1 Like