Alteryx Designer

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

HELP!! Need help with nested left funtion

Highlighted
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!!

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

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

Highlighted
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. 

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@AuditPro13 

 

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

 

fieldname.png

 

 

Cheers,

Highlighted
14 - Magnetar
14 - Magnetar

@AuditPro13 ,

 

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

 

Cheers!

Esther

Highlighted
8 - Asteroid

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

Labels