Skip to main content
Solved

Attribute Validator with attributes that have a ?

  • September 27, 2016
  • 7 replies
  • 46 views

Forum|alt.badge.img

I am trying to validate multiple attributes. The problem is there are <commas> in several attribute names. For example USETYPE = Yes, Type "B" Crossing or Yes, Type "A" Crossing. So when I go to validate them using the "IN" validation rule it would technically be three attributes.

Yes, = 1 attribute

Type "B" Crossing Yes, =2 attributes

Type "A" Crossing = 3 attributes

is there a workaround to make FME think Yes, Type "B" Crossing is 1 attribute?

I was thinking using Reg Ex with an OR statement, but this would be a long statement as there are several attributes like this and would have to research heavily as it has been a while. Any help would be MUCH appreciated.

Best answer by ebygomm

I've always used quotation marks (not apostrohpes) for this scenario, then doubled up the quotes within the string, e.g.

"Yes, Type ""A"" Crossing","Yes, Type ""B"" Crossing"

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

7 replies

Try isolating your attribute values using apostrophes ' like this :


Forum|alt.badge.img
  • Author
  • September 27, 2016

Try isolating your attribute values using apostrophes ' like this :

Great idea @francoissimard9 but when I do that here are the results?

 

_fme_validation_message_list{0} (string): Attribute 'USETYPE' with value 'Yes, Type "B" Crossing' fails check for in 'No,Unknown'

 

 

this is what I did....

 

'No','Yes, Turned','Yes, Turned and Stacked Parallel (2 Bends)','Unknown','Yes, Type "B" Crossing','Yes, Type "A" Crossing'

 

 


Try isolating your attribute values using apostrophes ' like this :

Hi @ mikesando, did you delete the old line (USETYPE IN No,Unknown) ?

 

 


Forum|alt.badge.img
  • Author
  • September 27, 2016
Hi @ mikesando, did you delete the old line (USETYPE IN No,Unknown) ?

 

 

I did, that was the result as in doing it like above it only recognized the No and Unknown attributes.

 

 


takashi
Celebrity
  • September 28, 2016
Great idea @francoissimard9 but when I do that here are the results?

 

_fme_validation_message_list{0} (string): Attribute 'USETYPE' with value 'Yes, Type "B" Crossing' fails check for in 'No,Unknown'

 

 

this is what I did....

 

'No','Yes, Turned','Yes, Turned and Stacked Parallel (2 Bends)','Unknown','Yes, Type "B" Crossing','Yes, Type "A" Crossing'

 

 

Hi @mikesando, the validation rules will be evaluated with 'AND' criteria - i.e. the feature will be output via the Failed port if it does not match one or more of the rules. From the resulting message, I therefore guess that this rule still remains as a validation rule. Make sure again.

 

USETYPE | In | 'No,Unknown'

 


ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • Best Answer
  • September 28, 2016

I've always used quotation marks (not apostrohpes) for this scenario, then doubled up the quotes within the string, e.g.

"Yes, Type ""A"" Crossing","Yes, Type ""B"" Crossing"


Forum|alt.badge.img
  • Author
  • September 28, 2016

I've always used quotation marks (not apostrohpes) for this scenario, then doubled up the quotes within the string, e.g.

"Yes, Type ""A"" Crossing","Yes, Type ""B"" Crossing"

This was the trick!! Thank you all for the help and input.