matching two column by numbers, Column expression or Rule Engine

If that case is false, then the rule is quite simple:
NFN column and IDs column must contain exactly the same numbers>0

If my assumption is correct, this result should be ok


The NFN and the IDs columns are transformed into lists alphabetically sorted, then they are matched. If this is ok, the final version of the algorithm won’t output the two “_tostring” columns, showing only the Matched col.

1 Like

Hi @duristef , based on your latest screenshot, any reason why are you eliminating the 0 when manipulating the data?

I believe if you had DBQuery:112 as NodeFullName and [(#0),(#112)] as IDs, you will end up with a true Matched (if I follow the logic in the screenshot, NFN_tostring would translate to {112} and IDs_tostring would translate to {112}), while it should be false (because in reality, IDs_tostring should translate to {0,112})

The examples in your screenshot all work out because whenever there were 0 in NFN, there were 0 in IDs, and whenever there wasn’t in NFN, there wasn’t in IDs either.

I’m just tryin’ to conform to what @Muhammad44 said

p.s all number fron NFN should match IDs column (that is what I was looking for) and dont bother about 0s.

@duristef Gotcha. Indeed, I see that.

Here’s another example


But I’m not sure if my assumption ( NFN column and IDs column must contain exactly the same numbers>0) is correct

@duristef thanks alot for your stuff. Actually for first picture is all correct but second picture for e.g

if you see last three rows is not correct because
what meant is NFN should match IDs in the same order (the order is different so that is why it should not be like that) . You can skip 0s but have to follow the order. For e.g.

0 100 496 should be in IDs column like 100 496 (´but in the picture it is #496 #100) so the order is wrong , eventually my problem could not solved.

Also I dont understand what you mean >0 approach ? where do you put that in coding?

Forget about the former versions of the code. They all sleep with the fishes, as someone would put it.
I’m trying to adapt one of them to the latest formulation of the matching rule, that is (but I could be wrong):

  • NFN column and IDs column must contain exactly the same numbers>0 (that is: 0s are irrelevant)
  • order is important

This is the latest result I get with my workflow. Is it correct, in particular the last 4 rows?

1 Like

@duristef yes these all correct to what I was looking for. Could you please also share the source of doing it :slight_smile:

Here’s the workflow, consisting of a single Column Expressions node.
immagine
match_2_cols_b.knwf (10.0 KB)

3 Likes

@duristef yes this one does so, all good to go now thanks for the support, your coding in expression works well

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.