Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Trim Right to pull back from a different column if there main column is empty

Karl_Spratt
8 - Asteroid

Hi Community,

Looking for some help please I'm trying to pull back the country code from our route column if the country column for that SO line is blank (empty) 

My formula is 

IIF(isEmpty([Country]), TrimRight([Route], "2") but I'm getting an Error:

Formula (18): Parse Error at char(48): Malformed If Statement (Expression #3)  see attached 

 

Can someone please explain how I'd pull back  UA from this UA-140

TIA 

Karl. 

3 REPLIES 3
fmvizcaino
17 - Castor
17 - Castor

Hey @Karl_Spratt ,

 

You need to include the false statement there or an additional parenthesis. Both are correct, it depends on what you are trying to do.

 

IIF(isEmpty([Country]), TrimRight([Route]), "2")

IIF(isEmpty([Country]), TrimRight([Route], "2"),"")

 

Best,

Fernando Vizcaino

fmvizcaino
17 - Castor
17 - Castor

Editing my response. I just saw your image and since you are trying to get the first 2 characters, your expression needs to be like this.

IIF(isEmpty([Country]), left([Route], 2),[Country])

Karl_Spratt
8 - Asteroid

thanks that worked. Really appreciate it..

Cheers,

Karl. 

Labels