Alteryx Designer Desktop Discussions

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

Separating cells that contain digits into a new column

KML
5 - Atom

Hi 

I'm trying  to create a new column that contains all the cells that have digits in them. I've tried using IF contains in the formula function but have not had much luck. Please see the attached image to see what I am trying to achieve.

Would really appreciate the help.

Thanks

 

 

2 REPLIES 2
Thableaus
17 - Castor
17 - Castor

Hi @KML 

 

I thought of two ways of doing it: 1 is RegEX free, the another one is not.

 

JobCodes.PNG

 

You can use RegEX to create a column that matches records that have a number and the other that doesn't..

OR

You could use Data Cleansing Tool, clean up numbers of your records and then join your original dataset with this cleaned one.

 

Whatever does not join to the original dataset is what demanded the cleaning process - the LEFT side, containing digits.

The joined side is all made by non-numbers.

You can then join multiple the three outputs - so you will have the original column, the one with records with letters and the other with records containing numbers.

 

See flow attached.

 

Cheers,

KML
5 - Atom

I ended up using IF REGEX_Match([Staff Name], ".\d+.*") THEN [Staff Name] ELSE Null() ENDIF. The cleansing method works too. Thanks for your help.

Labels