Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
RÉSOLU

Validation check on string column where values are double or not

alt_tush
Comète

Hi,

 

I have below data table with columns Values. (Values column datatyppe is Vstring 255)

 

Values
0.11
0.23
2.34
5.44
aa
.
bb
#$
afdf.adfa
5
7
8
1223.56

 

 

I want to add checks for double value as this column require entries only for double. If there is no about value found the in other column should update Yes or No like below

 

ValuesDouble_Y_N
0.11Yes
0.23Yes
2.34Yes
5.44Yes
aaNo
.No
bbNo
#$No
afdf.adfaNo
5No
7No
8No
1223.56Yes

 

Thank you for your help :)

5 RÉPONSES 5
ShankerV
Castor

Hi @alt_tush 

 

One way of doing this

 

ShankerV_0-1684138848156.png

IF REGEX_Match([Values], "\d+.\d+")
THEN "Yes"
ELSE "No"
ENDIF

 

ShankerV_1-1684138861525.png

 

Many thanks

Shanker V

binuacs
Arcturus

@alt_tush Similar to @ShankerV solution

binuacs_0-1684142420272.png

 

alt_tush
Comète

Hi Shanker V

 

It works. Thank you for your quick response. :)

alt_tush
Comète

Hello Shankar V,

 

If my column having negative values like -1.23, -234.56 etc it goes to No instead of Yes.

Because negative is also the numeric value. So what need to add in your formula to access negative values too.

 

I think here i need to change right? 

IF REGEX_Match([Values], "\d+.\d+")
THEN "Yes"
ELSE "No"
ENDIF

 

Really appreciate your help :)

Thank you,

ShankerV
Castor

Hi @alt_tush 

 

Please use the below formula to use - (Negative) numbers also.

 

ShankerV_0-1684215954470.png

IF REGEX_Match([Values], "-{0,1}\d+.\d+")
THEN "Yes"
ELSE "No"
ENDIF

 

ShankerV_1-1684215973645.png

 

Many thanks

Shanker V

Étiquettes