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

int and str in one column

Timo97
7 - Meteor

Hello everybody, 

 

does somebody know how i can detect or select only str/int in one column. 

i have numbers and words in there....

 

would be really happy if someone could help me with this 🙂

 

LG Timo 

7 REPLIES 7
mst3k
11 - Bolide

you will need the regex tool

https://help.alteryx.com/20213/designer/regex-tool

 

you will need to learn how to set up the pattern to match what your data looks like and what you're trying to do. you can use this tool to pick only text characters or only numbers or a lot of other patterns

Emil_Kos
17 - Castor
17 - Castor

Hi @Timo97,

 

One column can have only one data type. Maybe you can create two new columns. Use a select tool in order to change the data type to the number and if some of them become empty when you change the data type you should create a new column with text but only for those positions that are empty. 

 

I hope that makes sense. 

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @Timo97 

 

If you want to split number and strings. Here is how you can do it.

Workflow:

atcodedog05_0-1632216491700.png

 

Hope this helps : )

 

Pravallika20
8 - Asteroid

Hi @Timo97 ,

 

Try isInteger() function. It will split the Integers and Strings seperately. Hope this helps

Pravallika20_0-1632217555199.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @Pravallika20 

 

Interesting IsInteger() works but IsNumber() doesn't work. Any thoughts why 🤔

Pravallika20
8 - Asteroid

Hi @atcodedog05 ,

 

isInteger() function checks if the value can be converted to Integer. Isnumber() function directly checks if the value is number. For further clarifications, please refer to https://help.alteryx.com/20213/designer/test-functions. 

 

danilang
19 - Altair
19 - Altair

@atcodedog05 

 

Isinteger() tries to convert the number.  IsNumber() checks the field type.

 

Btw.  The regex examples above need to be modified to check for an optional "-" in the case of negative integers.  

REGEX_Match([Field1],"-{0,1}\d+")

 

Dan

Labels
Top Solution Authors