Skip to main content
Solved

Testing values coming separately into tester

  • September 13, 2018
  • 7 replies
  • 166 views

mario_bla
Participant
Forum|alt.badge.img+6

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

Best answer by hollyatsafe

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.

View original
Did this help you find an answer to your question?

7 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+36

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.


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • September 13, 2018

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


virtualcitymatt
Celebrity
Forum|alt.badge.img+36
ebygomm wrote:

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!

 

 


Forum|alt.badge.img+2
  • Best Answer
  • September 13, 2018

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.


mario_bla
Participant
Forum|alt.badge.img+6
  • Author
  • Participant
  • September 14, 2018

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...


fpakzat
Contributor
Forum|alt.badge.img+3
  • Contributor
  • December 2, 2019

Matcher worked for me.


fpakzat
Contributor
Forum|alt.badge.img+3
  • Contributor
  • December 2, 2019

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)?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings