Skip to main content

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.

Try isolating your attribute values using apostrophes ' like this :


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

 

 


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.

 

 


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'

 


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"


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.

 

 

 


Reply