Question

AttributeValidator vs Tester: value in one field matches value in another field

  • 4 July 2018
  • 1 reply
  • 1 view

Badge +7

After joining two datasets on A_Field1 = B_Field1, I want to check that A_Field2 = B_Field2. I don't need to include Field2 in the join as I will be dropping B_Field2 before the Writer. It's just to catch mismatches that may be down to typos, for example.

I can do this in Tester (A_Field2 = B_Field2), which correctly finds 2 mismatches out of 68,090 features.

In AttributeValidator, I thought this might work:

Attributes to Validate = A_Field2

Validation Rule = In

Rule Configuration = B_Field2

This matches 134 features, but rejects the rest. On the Readers, one field type is Integer while the other is Text. Could this explain it? But I thought the field types are effectively discarded once the data is read in...? And in any case, Tester works.

Am I doing something wrong in AttributeValidator, or is its behaviour different from Tester?


1 reply

Userlevel 2
Badge +17

Hi @tim_wood,

FME originally converted all attributes to strings, but for the last few versions, we have been retaining the attribute data types, to expand the types of attribute manipulations we can do.

The Tester allows you to choose the testing mode, but is set to Automatic by default, which will compare operands as numbers if possible, and as strings otherwise.

The AttributeValidator is not as forgiving, since its purpose is validation, rather than content matching.

Reply