Skip to main content
Solved

AttributeValidator not finding words


Forum|alt.badge.img

Im using the AttributeValidator to test words appears in my .csv file. It finds the following no problem - raised defence (man-made), but it keeps failing for the following - sea defence (man-made), even thought it appears in the list to test for. I have checked spelling and made sure there are not any extra spaces but it doesnt seem to recognize the word in the .csv file. Has anyone else had a similar problem?

 

Best answer by david_r

Try double-quoting all the list elements:

"coastal","defence","sea defence (man-made)","raised defence (man-made)","sea"
View original
Did this help you find an answer to your question?

10 replies

david_r
Evangelist
  • October 31, 2017
Could you perhaps upload a minimal workspace that reproduces the issue? It would be very helpful.

Forum|alt.badge.img
  • Author
  • October 31, 2017

I tried but now both raised defence (man-made) and sea defence (man-made) fail :-s

av-example.fmw


david_r
Evangelist
  • Best Answer
  • October 31, 2017

Try double-quoting all the list elements:

"coastal","defence","sea defence (man-made)","raised defence (man-made)","sea"

mark2atsafe
Safer
Forum|alt.badge.img+43
  • Safer
  • October 31, 2017
Seems to be the - (dash) character that's the problem. I'll check with the developers and file a request to fix. In the meantime, as @david_r says, enclose the values in quotes in the AttributeValidator and all is OK.

 


mark2atsafe
Safer
Forum|alt.badge.img+43
  • Safer
  • October 31, 2017
Filed with developers. Reference: PR#80254

 

 


Forum|alt.badge.img
  • Author
  • October 31, 2017
david_r wrote:

Try double-quoting all the list elements:

"coastal","defence","sea defence (man-made)","raised defence (man-made)","sea"
It solved the problem in the test one and it is now working in my main dataset thank you. However, it's now failing to recognize - flood_gate, i've tried it with and without " "

 

 


mark2atsafe
Safer
Forum|alt.badge.img+43
  • Safer
  • October 31, 2017
cam wrote:
It solved the problem in the test one and it is now working in my main dataset thank you. However, it's now failing to recognize - flood_gate, i've tried it with and without " "

 

 

I think you'll need to provide another workspace with an example of that. When I try it, it works for me.

 

 


mark2atsafe
Safer
Forum|alt.badge.img+43
  • Safer
  • October 31, 2017
Our developer says she will try and fit a fix into FME2018. So, no guarantees, but it will hopefully be fixed very shortly.

 


Forum|alt.badge.img
  • Author
  • October 31, 2017
Ok thank you

 

 


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • November 1, 2017
david_r wrote:

Try double-quoting all the list elements:

"coastal","defence","sea defence (man-made)","raised defence (man-made)","sea"
I think this is a defect of the Help on the AttributeValidator.

 

Regarding the In operator, the help says "A list of values in which you are testing for a certain value. The Right Value is a comma-delimited list of values, or a range". However, there is no description about how you can set a "range" by the In operator and how you can test strings that contain a hyphen with the In operator.

 

In the Help on the Tester, there is this description.

 

"String ranges (i.e. a-d) can also be specified. If you want to test for values that contain a hyphen, those values should be enclosed in quotation marks. For example, if x=LL-27, then x In "LL-27","LL-83" would be true. On the other hand, x In LL-27,LL-83 would be false. This is because LL-27 and LL-83 are treated as two empty string ranges, since numbers are ordered earlier than letters when considered as strings."

 

I think the same description should be added to the Help on the AttributeValidator.

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