Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Formula results in string but field is numeric

wonka1234
10 - Fireball

Hi,

 

Trying to create a formula tht outputs this as a fixed decimal. 

Where am I going wrong?

 

IF !isNull([Date])

then ([Col1] + [Col2]) / [Col3]

else ""

ENDIF

 

 

Date - string

Col 1 - Double

Col 2 - Double

Col3 -  int64

2 REPLIES 2
alexnajm
18 - Pollux
18 - Pollux

What is the error that you are seeing? Can you take a screenshot of your configuration?

caltang
17 - Castor
17 - Castor

Try this:

IF IsNull([Date])
THEN ([Col1] + [Col2])/[Col3]
ELSE 0
ENDIF

 

You ended the ELSE statement with a "", that's a blank/empty, and will force it to be a String I believe. 

 

In addition, make sure to set the data type to Fixed Decimal in your Formula bar and set the scale (decimal places) accordingly.

 

Hope this helps,

Cal

Calvin Tang
Alteryx ACE
https://www.linkedin.com/in/calvintangkw/
Labels
Top Solution Authors