Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

How to use Regex Tool for data cleansing for multiple column in one go

Kavita_22
5 - Atom

How to use Regex Tool for data cleansing for multiple column in one go ?

I need regex tool to do below activity

1. Replace with 0

2. Remove all leading space

 

5 REPLIES 5
Yoshiro_Fujimori
15 - Aurora

Hi @Kavita_22 ,

I would use Data Cleansing Tool.

Is there any reason you prefer RegEx tool?

DataCleansingTool.png

rzdodson
12 - Quasar

Another approach to the Data Cleansing tool is a Multi-Field Formula tool (my preferred method). It allows for me to insert more complicated syntax, specifically Regex logic, in it without the need for an additional Formula tool after a Data Cleanse. 

Kavita_22
5 - Atom

I have used Data Cleansing tool,
but in case error comes up related to selected column any where in process flow, the selected columns get unticked automatically from data Cleansing tool
and then after sorting the error, I am required to select the column again (the no. of columns to select is too high). So was searching for another method 

Kavita_22
5 - Atom

I have used Data Cleansing tool,
but in case error comes up related to selected column any where in process flow, the selected columns get unticked automatically from data Cleansing tool
and then after sorting the error, I am required to select the column again (the no. of columns to select is too high). So was searching for another method 

BS_THE_ANALYST
14 - Magnetar
14 - Magnetar

@Kavita_22 

 

You'll need 2 multi-field formula tools. One to clean up your string columns and one to clean up your numeric columns. You can configure this easily by choosing the "type" in the multi-field formula tool's configuration + you can select "unknown" to make it dynamic and therefore less work. 

 

To remove trailing and leading spaces you'll need to use TRIM().

To replace nulls with 0s you'll just need an if statement like IIF(isempty([column here]), 0, [column here])

 

I see no need for regex here. That's for more complex string manipulation.

 

all the best,

BS

All the best,
BS

LinkedIN

Bulien
Labels