Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
RESUELTAS

IF c THEN t ELSE f ENDIF with RIGHT function

Keilynbarrera
Meteoroide

Hello,

 

I'm trying to use the formula too to return lines of data where th.e GLAccount numbers have the last three digits equal '037' or '041' but my formula turns black once I add in "else Null() Endif". Also I am getting a Malformed State error. Anyone see any reason this formula should not work? My data type is Int32. 

 

IF Right([GLAccount], 3) in ('037', '041') THEN -[FunctionalAmount] else Null() ENDIF

4 RESPUESTAS 4
AngelosPachis
Nebula

Hi @Keilynbarrera ,

 

The Right function can only be used with String data type fields.

 

Can you try adding the GL account to a ToString function?

 

IF Right(Tostring([GLAccount]), 3) in ('037', '041') THEN -[FunctionalAmount] else Null() ENDIF

 

Cheers,

 

Angelos

Qiu
21 - Polaris
21 - Polaris

@Keilynbarrera 

As @AngelosPachis pointed out, the Right and In function only work for string type data.

and we can also use the contain function for your purpose here.

Capture1A.PNG

Keilynbarrera
Meteoroide

Thanks! That solved it!

Qiu
21 - Polaris
21 - Polaris

@Keilynbarrera 

Glad to help and thank you for the accept mark. 😁

Etiquetas
Autores con mayor cantidad de soluciones