Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Using formula tool to produce text, currently only showing 0 in output column.

Deano_280
5 - Atom

Hi guys,

 

I am trying to produce a text output which is based off comparing two numeric columns. Formula I'm using below however the output only shows 0 instead of the text shown below.

 

Age, Comments and Commentary columns all set to V_String.

 

IF
[AGE]<[Comments] then [Commentary] = "within policy"
elseif [AGE]>=[Comments] then [Commentary] = "outside of policy"
ELSE
Null()
ENDIF

 

Thanks in advance.

 

 

3 REPLIES 3
ShankerV
17 - Castor

Hi @Deano_280 

 

Please use the below.

 

IF ToNumber([AGE])<ToNumber([Comments])
THEN "within policy"
ELSEIF ToNumber([AGE])>=ToNumber([Comments])
THEN "outside of policy"
ELSE Null()
ENDIF

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @Deano_280 

 

Result for Formula tool.png

 

Have done the modification in the formula shared, 

 

1. Added tonumber() this helps to convert string to number checking age > comments

2. After THEN removed the column name, as it is given at the top

 

Many thanks

Shanker V

Deano_280
5 - Atom

That's done it thank you very much!

Labels