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

Alteryx Designer Desktop Discussions

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

Formula for numbers and string mixture

calvincarr29
8 - Asteroid

I need a formula for:

 

Column Name: Account Number

 

If Account Number contains a letter then it's a string otherwise it's a number

 

 

7 REPLIES 7
binuacs
21 - Polaris
calvincarr29
8 - Asteroid

@binuacs Coming through with the solution again. Thank you. But I need more of a conversion. 

 

I'm spitting this workflow into an excel template with formulas. However, the excel formulas aren't working because it's reading Account Numbers as a text rather than numbers. I want to eliminate having to manually convert them in excel.

 

 
 

aa.PNG

 

binuacs
21 - Polaris

@calvincarr29 The account number field contains both numeric and string, therefore the entire field will be considered as string data type. 

calvincarr29
8 - Asteroid

IIF([Account Number], [Account Number],IsString([Account Number])) is producing

bb.PNG

 

It gets rid of the one with letters which I don't want

 

 

binuacs
21 - Polaris

@calvincarr29 in that case use the below formula m nake sure the output is selected as double data type

image.png

calvincarr29
8 - Asteroid

Is there a way to keep the numbers with the letters as well? 

 

If Account Number contains letters leave it alone otherwise convert to number.

binuacs
21 - Polaris

@calvincarr29 That is not possible in Alteryx, a single field can't have two data types, If any of the values contains letters it will be considered as string type

 

Labels
Top Solution Authors