ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

formula -end part

Hi2023
Astéroïde

Hi, 

 

Why wont it work? what am I doing to the end?

 

if REGEX_CountMatches([PAYEE ADDR 1] AND [PAYEE ADDR 2], "[A-Za-z]") > 0 then "Text"

elseif REGEX_CountMatches([PAYEE ADDR 1] AND [PAYEE ADDR 2], "[0-9]") > 0 then
"Int" else endif 

 

thanks

9 RÉPONSES 9
FinnCharlton
Pulsar

Hi @Hi2023 , you are missing something between the 'else' and 'endif'. The formula requires that you put something in the 'else' clause so it knows what to return if neither of your conditions are true. You could use 'else null() endif' to return NULL if neither condition is true.

binu_acs
Polaris

@Hi2023 you need to re-write the formula like below

IF REGEX_CountMatches([PAYEE ADDR 1], "[A-Za-z]")> 0 AND  REGEX_CountMatches([PAYEE ADDR 2], "[A-Za-z]") > 0 Then "Text"
elseif REGEX_CountMatches([PAYEE ADDR 1], "[0-9]")> 0 AND  REGEX_CountMatches([PAYEE ADDR 2], "[0-9]") > 0 Then 'Int' Else
Null()
EndIf

 

apathetichell
Arcturus

I read it as [PAYEE ADDR 1] + [PAYEE ADDR 2] (concatenated string) - either way your problem is the AND  - AND is a boolean term. You can use it in Boolean compare - in strings you can use +...

Hi2023
Astéroïde

How would I write this to see for the text column- I wanted to check if there was ANY numbers in the column versus NO numbers in the column

binu_acs
Polaris

@Hi2023 One way of doing this

binuacs_0-1683045362664.png

 

apathetichell
Arcturus

Maybe like this?

Hi2023
Astéroïde

But I need this for PAYE ADDR1 

AND 

 

PAYE ADDR 2

binu_acs
Polaris

@Hi2023 Do you need to I check both on the same formula, if yes as @apathetichell @suggested concatenate both fields then apply the formula 

 

ie [PAYEE ADDR 1] + [PAYEE ADDR 2] 

apathetichell
Arcturus

use the workflow I uploaded. Select the fields you need in the multi-field.

Étiquettes
Auteurs des meilleures solutions