community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Formula Tool Returning 0 or -1 instead of String Text based off Conditional If Statement

Highlighted
Meteoroid

I am trying to get the ACTION_REASON_DESCRIPTION field to return Terminated, Retired, or Death, based off the conditional IF Statement Below. The Data Type is V_W String, yet the output is returned as either 0 or -1. I have tried every string data type possible and the output remains 0 or -1. I do not understand why I am getting this output rather than what I specified in my Formula Tool Expression.

 

ACTION_REASON issue Part  1.pngIf StatementACTION_REASON issue Part  2.pngOutput Field and Data TypeACTION_REASON issue Part  3.pngWhat is being returned

Alteryx Certified Partner
Alteryx Certified Partner
IF 
[Employee_Status] = 'T' THEN 'Terminated'  ELSEIF
[Employee_Status] = 'R' THEN 'Retired'  ELSEIF
[Employee_Status] = 'D' THEN 'Death'  
ELSE
Null()
ENDIF

very close!  You don't need to specify the new variable in the syntax.

 

Thanks,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.
Alteryx Partner

This formula should be written to the specific field. In this particular example, the field name should be [ACTION_REASON_DESCRIPTION].

Labels