Solved

Testing values coming separately into tester

  • 13 September 2018
  • 7 replies
  • 20 views

Badge

Hello,

what am I doing wrong? Let's say that I have some attributes whose values I want to compare with tester. Each attribute value comes into tester separately. No matter what I do, I always get "failed" result from tester (even when the values are the same). I used 3 Inspectors and I see that both values which are coming into tester are number (number 5 in this examle) but I can't figure out what's going on inside tester.

I'm attaching small example file.

Please help.

Mario

icon

Best answer by hollyatsafe 13 September 2018, 18:12

View original

7 replies

Userlevel 4
Badge +26

Ahhh the problem here is that the tester is designed to test each feature with itself, so does attribute 'A' equal attribute 'B'. It's not designed compare two different features.

Userlevel 1
Badge +21

The tester tests between attributes in the same feature. It doesn't compare values of different features against each other. If you want to find instances where attributes match across different features then you need a different transformer, e.g. a matcher

Userlevel 4
Badge +26

The tester tests between attributes in the same feature. It doesn't compare values of different features against each other. If you want to find instances where attributes match across different features then you need a different transformer, e.g. a matcher

Oh yeah the Matcher! That should do the trick!

 

 

Badge +2

Hi @mario_bla,

Just to expand on the other answers here - in the example workspace you have provided the result of the two AttributeManagers looks like this:

The Tester will only look at a single feature (ie row) so the reason your test is failing is because it is actually comparing 5 with the <missing> value. If you want these newly created attributes to belong to the same feature you will first have to join them based on a common value or alternatively just use a single AttributeManager.

So now if you set the Tester to A = C it will pass but A = B would fail.

Badge

Thank you all for your help. In the end, I did it with FeatureMerger. The most important help from you was to let me know that I was using tester the wrong way. I needed to compare two attribute values and if they are not the same the Terminator terminates the workbench. So I used FeatureMerger and put the Terminator on the NotMerged output port. I don't know if that is the best approach but it seems it's working. I tried also the Matcher but after 5 minutes of trying I quit and tried with FeatureMerger...

Badge

Matcher worked for me.

Badge

is it possible to create a variable out of a "Not Matched Record" that stores some text (to indicate the not-matched reason) and then I can send this string variable to same Terminator (as well as possibly an emailer)?

Reply