Alteryx Designer Desktop Discussions

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

Text data cleaning

PB41091
7 - Meteor

I have a column with 3 types of input values in 1 column as shown in the below table (ex. 160 BP, 0.5%, 101.0 BP) and I have to perform cleaning in a way to get values as shown in output column

 

InputOutput
160 BP160
0.5 %50
0.5 BP0.5
105 BP105
101.0 BP101
100.0 BP100
1.88 BP1.88
1.89 %189
1.89 BP1.89
103 BP103
160.0 BP160
1 %100
0.95 %95
1.91 %191
150.0 BP150
2 REPLIES 2
DataNath
17 - Castor

Hey @PB41091, as far as I can tell, these look to be the conditions needed to get your expected values. However, please do let us know if not or if you face any issues when applying this to a wider dataset!

 

IF Contains([Input], 'BP') then ToNumber(Replace([Input], ' BP', '')) else ToNumber(Replace([Input], ' %', ''))*100 endif

 

DataNath_0-1661425686479.png

PB41091
7 - Meteor

Perfect, it is working. Thanks for your help :)

Labels