Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Data Cleaning - What is the best method?

shpruitt
7 - Meteor

I'm new and struggling. I am trying to data cleanse columns of data that say 'USA-Senior Associate' and 'USA-Competency' and I would like to remove the 'USA-' from both sets. How do I do this?

Thanks

6 REPLIES 6
BenMoss
ACE Emeritus
ACE Emeritus
A few options here but I'd go with the simplest in my eyes which would be to use the text to columns with a - delimiter.

Ben
MarqueeCrew
20 - Arcturus
20 - Arcturus

@BenMoss,

 

Windex!  Get something to clean those glasses.

 

Replace([_CurrentField], "USA-", '')

What could be easier than this formula (which by the way will work nicely in a multi-field formula tool.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
Bob_Blackey
11 - Bolide

Just to throw another option in there (SO many ways to do things in Alteryx), and keeping in the vein of the using the Multi_Field Formula Tool to clean several fields;

 

Substring([_CurrrentField_],FindString([_CurrentField_],"-")+1)

 

Findstring finds the 0 based position of the -

Substring starts at the character after the - and takes the rest of the string

 

This would work if you have other prefixes besides USA

I'm using _CurrentField_ here as that's the format of the Multi_field Formula tool - in a standard formula tool replace it with the field name.

 

Cheers,

Bob

 

shpruitt
7 - Meteor

So I have inserted the multi-field formula after my import of data.

I selected both columns (V-strings) that I would like to start with (as you guessed there are many that need the 'USA-' gone).
The Copy Output Fields Add box is already checked so I left it alone (it says 'New_ as a prefix).

I tried your formula and I tried Replace([_CurrentField_], "USA-", "") and neither of those seem to be doing anything. I did it in the single formula option and did get it to work - but I would love to learn how to use this multi-formula instead of cheating and doing 3-4 formulas right after each other. Alteryx_Pic.png

BenMoss
ACE Emeritus
ACE Emeritus

Be sure to either scroll right in your results window, or deselect the option 'Copy output fields Add'. If you have this option checked it will create as many knew fields as those selected which will be added to the right side of your table, commonly out of view.

 

Ben

The_Data_Loop
8 - Asteroid

You could also simply pad the first 4 characters out.

 

 

Labels