Alteryx Designer Desktop Discussions

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

Separate/Remove characters after "-"

PassION_es
10 - Fireball

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 REPLIES 4
usmanbashir
11 - Bolide

@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
13 - Pulsar

You can use the following in a Formula tool.

 

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

@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
10 - Fireball

Great. Thanks @usmanbashir 

Labels