ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Remove some Zeros but Not All

mmh2023
6 - Meteoroid

Hi! 

I am trying to figure out a formula to remove the last three zeros in a string but still keeping one of the zeros so that it is a 4 digit number. 

 

For example: in the RegExOut1 column first line I would like for that to output to the account column as 1130 instead of 1130000

maddiehamn_0-1681937734872.png

Thank you! 

4 REPLIES 4
BS_THE_ANALYST
15 - Aurora
15 - Aurora

@mmh2023 
REGEX_REPLACE([RegExOut1], "(.*)000$","$1")

 

 

All the best,
BS

LinkedIN

Bulien
binu_acs
21 - Polaris

@mmh2023 What is the data type of your Account field? is it double?

BS_THE_ANALYST
15 - Aurora
15 - Aurora

perhaps LEFT([RegExOut1],4) is also achieving what you want? If you only want the first 4 digits @mmh2023 

 

All the best,
BS

LinkedIN

Bulien
binu_acs
21 - Polaris

@mmh2023 Another option with the string functions

binuacs_0-1681938579211.png

ReverseString(Substring(ReverseString(toString([ RegExOut1])),2,Length(toString([ RegExOut1]))))
Labels
Top Solution Authors