In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

Filter Words from Column with String data type

Apollo
5 - Atom

Hello World,

 

I have a field of records with a column (2017 YTD) with data type as string containing both double/float values as well as word. Sample:

 

2017 YTD
7.9
-0.04
0.02
On Target
On Target
On Target
0.047
0.37
100.00
0.389

 

which is being read in alteryx as 

 

2017 YTD

7.9
-0.04
2.29E-2
On Target
On Target
On Target
4.7E-2
0.373
100
0.38900000000000001

 

What I need to do is filter the string 'On target' or any words that come up in the records or the float/double values from the column so that I have two separate columns with the same consistent data type (String and Double) from point of view of automating the process. 

Any help will be appreciated.

2 REPLIES 2
Joe_Mako
12 - Quasar

One option is you can use a Formula tool with two fields:

 

Number:

ToNumber([2017 YTD],1,1)

 

String:

IF IsNull([Number]) THEN [2017 YTD] ELSE Null() ENDIF

 

In the To Number function, the first argument is what we want to attempt to convert into a number, the second argument of 1 tells it to ignore errors so the results messages stay clean, and the last argument of 1 tells it to convert any non-number values into a null value. The second function uses the null result to know when the raw value is a string.

 

to number and string.png

Apollo
5 - Atom

Thanks Joe_Mako.

I used a filter thereafter to separate the Nulls and the select tool to remove the extra columns.

Thank you!

Labels
Top Solution Authors