Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

Need to segregate Numbers and alpha numeric column

Laksh345
メテオロイド

I have the below data and below to that is my requirement:

 

Column A 1 2 3 5 6 7 8 9 AA BB CC1 DD2-1 

Column B 

 

If Column A is > 5 it should say "Individual" in column B 

If Column A is <5 it should say "Common" in column B 

If Column A is alphanumeric or alphabets it should say "Individual 1" in column B

6件の返信6
ChrisTX
オーロラ

Try this in a Formula tool:

 

IF ToNumber([My Field],1,1) > 5 THEN "Individual"
ELSEIF ToNumber([My Field],1,1) < 5 THEN "Common"
ELSEIF IsNull(ToNumber([My Field],1,1)) THEN "Individual 1"
ELSE "<unknown>"
ENDIF

 

What if Column A = 5?

 

Chris

Laksh345
メテオロイド
Below is the data , formula used and result. It is not working.
binuacs
アルクトゥルス

@Laksh345 based on my understanding

IIF(REGEX_CountMatches([Vendor Number], '^\D+'),'Individual 1',IIF(Length([Vendor Number]) > 5,'Individual',  IIF(Length([Vendor Number])<= 5, 'Common',Null())))

image.png

ChrisTX
オーロラ

In the Formula tool, you are updating the value for the field "Type", which is defined as data type Boolean.

 

Create a new field with a string data type if you want values like "Individual".

 

Screenshot 2024-05-06 105923.png

Laksh345
メテオロイド

Thank you Chris. It worked!

Laksh345
メテオロイド

Thank you. It is not about the length, it is about the Alpha numeric. Thanks for your help. I got an solution anyway.

ラベル