Alteryx Designer Desktop Discussions

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

HELP!! Need help with nested left funtion

AuditPro13
8 - Asteroid

Hi All,

 

Need to return right 4 if length is greater than 4. Please help!! 

 

IF Length([Year of FYE (As adjusted)]) > 4
THEN Right([Year of FYE (As adjusted)],4)
ELSE [Year of FYE (As adjusted)]
ENDIF

 

Thank in advance!!

5 REPLIES 5
Thableaus
17 - Castor
17 - Castor

Hi @AuditPro13 

 

What kind of error are you bumping into?

 

Is your field an Int Number?

If so, you need to use ToString function in combination with a ToNumber function.

 

IF Length(ToString([Year of FYE (As adjusted)])) > 4
THEN ToNumber(Right(ToString([Year of FYE (As adjusted)]),4))
ELSE [Year of FYE (As adjusted)]
ENDIF

AuditPro13
8 - Asteroid

Hi @Thableaus,

 

The error says "The field "" is not contained in the record. Please noted the data is V_string. 

 

The one you sent is not working currently. 

Thableaus
17 - Castor
17 - Castor

@AuditPro13 

 

Oh, you need to give your field a Name in the Formula Tool configuration.

 

fieldname.png

 

 

Cheers,

estherb47
15 - Aurora
15 - Aurora

@AuditPro13 ,

 

I make the same mistake all the time, forgetting to name the field. @Thableaus , good catch!

 

Cheers!

Esther

AuditPro13
8 - Asteroid

Stupid mistake on my end! Thanks for your help!!

Labels