Alteryx Designer Desktop Discussions

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

IF c THEN t ELSE f ENDIF with RIGHT function

Keilynbarrera
6 - Meteoroid

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 REPLIES 4
AngelosPachis
16 - 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
20 - Arcturus
20 - Arcturus

@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
6 - Meteoroid

Thanks! That solved it!

Qiu
20 - Arcturus
20 - Arcturus

@Keilynbarrera 

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

Labels