Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Conditional Formula

Zuleyka7
5 - Atom

Hello, 

 

I created a new column and I want to create a formula to take the value greater than or equal to zero from my prior column, but I got an error.

 

Zuleyka7_0-1666892688335.png

 

3 REPLIES 3
gyang3
Alteryx
Alteryx

@Zuleyka7 I highly suggest posting a screenshot or description of the error, as that'd be extremely helpful for the community when trying to troubleshoot your issue.

 

With that said, it seems like the column "Net Income After Tax" may contain non-numeric characters and Alteryx is reading that column datatype as a String thus giving you an error.

 

You may want to take a look at your data and see why there's non-numeric characters or if you just want an easy fix, you can drop in a Select tool to change the datatype of that column to a numeric datatype (Float/Double/FixedDecimal/etc...).

 

Hope that helps!

gautiergodard
13 - Pulsar

Hey @Zuleyka7 

Agree with @gyang3 - check to ensure the net income column is a numerical data type (double, int, etc)... If you are creating a new column with your formula, you should also ensure you are selecting the appropriate data type for your new column within the formula tool.

Qiu
20 - Arcturus
20 - Arcturus

@Zuleyka7 
In the if part you are comparing the field "Net Income after Tax" with 0, meaning you are considering it as a numeric field, then in the Then part, you are using the field "Net Income after Tax" as a string so one of these statement is wrong.

You should check the data type of "Net Income after Tax"

If it is numeric, then you use the formula ToString([Net Income after Tax]) in the Then part.

If it is string, then you can use the formula ToNumber([Net Income after Tax]) in the If part.

 

Labels