Skip to main content

I have a column of data with a 10-digit alphanumeric value.  I need to keep those values and in a new column return just the last 5 characters of that column

I thought it would be as simple as creating a new column in the attribute manager and then in the attribute column I put in the string function @Right(NODE_NUM, 5)

I have tried at least 4 or 5 different formatting methods, using quotes “ “ or extra parentheses while writing out the string function, but I am lost.  I use this exact same string function in MapInfo all the time and it works like a charm.  But when I put in these values in just inserts “e_num” into each row as e_num are the last from characters of NODE_NUM.

What am I doing wrong?

results in

Thanks in advance

I would recommend using the SubstringExtractor, I think that should do what you are looking for. Here is its documentation: https://docs.safe.com/fme/html/FME-Form-Documentation/FME-Transformers/Transformers/substringextractor.htm


If you were wanting to use the Right string function on the value of an attribute like node_num, then you need to type it differently. You could either double click the attribute from the FME Feature Attributes panel, or type it “@Value(node_num)” instead of “node_num”.


Thanks so much, your second suggestion worked the first time I put it in.  I had actually typed that out exactly as you wrote it but that did not work, but double clicking the attribute inserted it perfectly and in the text editor @Value and the node_num part were in different colours, not sure if that had something to do with it, but double clicking worked, and typing it in manually did not.

Thanks so much!

 


Your welcome, yes the @Value and the attributes name should be different colours when it is working correctly.


Reply