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.
RESUELTAS

Separate/Remove characters after "-"

PassION_es
Bola de fuego

Hello Alteryx,

 

May I know how to remove the characters after a hyphen "-"?

 

Input:

133ADF-A

133ADF-B

133ADF-C

2563-A

2563-B

2563-C

 

Output:

133ADF

133ADF

133ADF

2563

2563

2563

 

Thank you in advance.

 

4 RESPUESTAS 4
usmanbashir
Bólido

@PassION_es One way is to use formula tool. Example formula:

Substring([Input],0,FindString([Input], '-'))

 

You can also use Text To Columns tool and use '-' as Delimiter. Then select the first field of the split columns. 

 

Hope this helps!

cjaneczko
Púlsar

You can use the following in a Formula tool.

 

REGEX_Replace([Input], "-.*", "")
Raj
Nebula

@PassION_es 
this can be achieved my multiple methods.
three are added.
1- Regex - "-." use this regular expression and output method as replace
2- text to column - "-" as delimiter and then use 1st column this will require a additional select tool but can be easily understood
3- formula tool -  update same column "REGEX_Replace([your input], "-.*", "")

hope this helps 
prefer which can be documented and feels easy to you>

PassION_es
Bola de fuego

Great. Thanks @usmanbashir 

Etiquetas
Autores con mayor cantidad de soluciones