Alteryx Designer Desktop Discussions

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

If formula issue

jonathanzadeh
7 - Meteor

I keep getting an error for the below formula. "The error is "invalid type in operator >." Both of my variable items are in double data type. Can't get what is wrong. Thanks for the help guys

 

IF [Charged Hours] > 0 THEN "Keep" ELSEIF [Budget Hours]>0 THEN "Keep" ELSE "Filter" ENDIF

 

7 REPLIES 7
jamielaird
14 - Magnetar

hi @jonathanzadeh 

 

Are you 100% sure that [Charged Hours] and [Budget Hours] are numeric fields, and that the field you are creating or editing in the formula tool is a string field?

Thableaus
17 - Castor
17 - Castor

Hi @jonathanzadeh 

 

Charged Hours or Budget Hours are probaly String types. At least one of them.

 

Check that.


Cheers,

jonathanzadeh
7 - Meteor

type.JPG

Thableaus
17 - Castor
17 - Castor

@jonathanzadeh 

 

Could you post a screenshot of your Formula Tool configuration?

 

Cheers,

jonathanzadeh
7 - Meteor

I posted the screenshot

jonathanzadeh
7 - Meteor

I found the issue and you guys pushing me about the data type pushed me to figure it out. I was using the join tool to change it to a double, then i used a union tool. For some reason after the union tool the data type changed back to a string. I used the select tool to fix the issue. Thanks guys

jamielaird
14 - Magnetar

Interesting. My assumption is that you had another version of the same field in the union which had a String field type and during the union that fields value was applied.

 

This is actually an interesting behaviour of the Union tool which I hadn't ever thought about. I did some testing to show that a numeric value being unioned to a string results in the both values becoming strings (regardless of the input or output order).

 

Screenshot 2019-05-14 at 19.27.09.png

Labels