Alteryx Designer Desktop Discussions

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

Data Cleansing Query

kushalb
7 - Meteor

Hi all,

 

I have bit cluttered data set with spacing issue in it like mentioned scenarios below in value1 column

 

UserIDValue1
134562British Columbia ,Canada
134562Canada,British Columbia
3547Canada,  British Columbia
45769  Canada,British Columbia

 

How to remove unwanted spacing between text and how to align all rows data in one format as it should be?

 

Thank you

5 REPLIES 5
ShankerV
17 - Castor

@kushalb 

 

Can you please share the expected output, so it is easy to understand.

 

How to remove unwanted spacing between text and how to align all rows data in one format as it should be?

 

The highlighted is little confusing requirement.

 

Many thanks

Shanker V

ShankerV
17 - Castor

@kushalb 

 

Seeking more clarity which you consider as unwanted space.

Space between , British 

or space between British Columbia

or space between British Columbia ,

ShankerV
17 - Castor

@kushalb 

 

I assume you are expecting the below output.

 

Value1
British Columbia,Canada
Canada,British Columbia
Canada,British Columbia
Canada,British Columbia

 

1. Use the Input tool

2. Use the Regex tool

Column to Parse - Value1

Regular expression -  (.*),(.*)

Output method - Parse

 

3. Use the Data cleansing tool

Select only 2 columns RegExOut1 and RegExOut2

Make sure the check box Leading and Trailing Whitespace is Ticked.

 

4. Use the Formula tool to join back

[RegExOut1]+','+[RegExOut2]

 

This will resolve your issue.

 

 

kushalb
7 - Meteor

I got the solution Shankar when i use Data cleansing and in there remove all whitespaces 

 

it worked.

ShankerV
17 - Castor

Welcome @kushalb 

Labels