Skip to main content
Solved

remove last 3 numbers


terezia86
Forum|alt.badge.img

HI everyone,

I would like to remove last 3 numbers from a value. For example 010003000 to > 010003... or 123456789 > 123456 (not all values are ending with 0)

so I do need some general formel for this.

any tips?

Thanks

Best answer by ebygomm

You can use a substring extractor with the following settings

View original
Did this help you find an answer to your question?

8 replies

david_r
Celebrity
  • April 14, 2020

There are several ways, but the simplest is probably to use the SubstringExtractor:

Negative index values are counted from the end of the string.


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • Best Answer
  • April 14, 2020

You can use a substring extractor with the following settings


danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • April 14, 2020
david_r wrote:

There are several ways, but the simplest is probably to use the SubstringExtractor:

Negative index values are counted from the end of the string.

Well done!


takashi
Influencer
  • April 14, 2020

Hi @terezia86, you can use the StringLengthCalculator to get the length (number of characters) of the value and extract desired substring with the SubstringExtrator, as in.

Just be aware that the index representing position of a character starts with 0, so you need to subtract 4 (not 3) from the total length.


terezia86
Forum|alt.badge.img
  • Author
  • April 14, 2020

Perfect!

THANKS!

 


takashi
Influencer
  • April 14, 2020
takashi wrote:

Hi @terezia86, you can use the StringLengthCalculator to get the length (number of characters) of the value and extract desired substring with the SubstringExtrator, as in.

Just be aware that the index representing position of a character starts with 0, so you need to subtract 4 (not 3) from the total length.

Ah yes, the index can be a negative number...


ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • April 14, 2020
takashi wrote:

Ah yes, the index can be a negative number...

It's a pity you can't use the negative numbers like that in an @Substring expression


david_r
Celebrity
  • April 14, 2020
ebygomm wrote:

It's a pity you can't use the negative numbers like that in an @Substring expression

Not a big deal, though...

@Left(@Value(text),@StringLength(@Value(text))-3)

Reply


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