Dev Space

Customize and extend the power of Alteryx with SDKs, APIs, custom tools, and more.
SOLVED

Numeric Column

AS
8 - Asteroid

Hi Everyone,

 

I have 2-3 column in excel that containing both numeric and string data and it's data type is string. But I need to apply some numeric formula's on it. so I tried to parse that column in To Number() function. but getting wrong result please help me. Example below

 

ABCDResult
NANAxNAreview
NANAxNAreview
2210xNAResult B within 90
1095244xNAreview
NANANANANo C
1095244xxscope

Note- "To Number function has space in formula because it is showing error to type else these both are together"

 

 

IF To Number([A])<91 THEN "Result A <90"

ELSEIF To Number([B])<91 THEN "Result B within 90"

ELSEIF [C]!="x" THEN "No C"

ELSEIF [D]="NA" THEN "review" ELSE "scope" ENDIF

 

 

Thanks in advance

1 REPLY 1
atcodedog05
22 - Nova
22 - Nova

Hi @AS 

 

Here is how you can do it. I am checking is A or B a number and the converting it to compare.

 

Formula:

IF REGEX_Match([A], "\d+") and ToNumber([A])<91 
THEN "Result A <90"
ELSEIF REGEX_Match([B], "\d+") and ToNumber([B])<91 
THEN "Result B within 90"
ELSEIF [C]!="x" THEN "No C"
ELSEIF [D]="NA" THEN "review" 
ELSE "scope" ENDIF


Workflow:

atcodedog05_0-1628748362748.png

 

Hope this helps : )