Skip to main content

I have a Condition Statement within AttributeManager that checks if an attribute has a letter at the end of the value.

If this is true then I use Substring to drop the last character.

However, when I use the above it always returns the original value (ex. 999a returns 999a instead of 999).

It does not seem to work with any negative number at the end but if I change -2 to a positive number like 3 it works and returns 999.

Any thoughts on what I am doing wrong here?

Regards

You can try the following expression:

@Left(@Value(HOUSENUM),@StringLength(@Value(HOUSENUM))-1)

Or using the SubstringExtractor transformer:


You can also do the whole thing in an AttributeCreator:

@ReplaceRegEx(@Value(HOUSENUM),"Ua-zA-Z]$","")

0684Q00000ArL1sQAF.png

FME is fun :-)


You can try the following expression:

@Left(@Value(HOUSENUM),@StringLength(@Value(HOUSENUM))-1)
The last one worked like a charm...your the man david_r.

 

 

Cheers

 


The Substring function takes a start position and a length as arguments.

The SubstringExtractor takes a start position and end position as arguments.

I know, confusing. Would be nice if they would take the same arguments.


Reply