Alteryx Designer Desktop Discussions

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

Formula function in Alteryx

jlaurenn11
6 - Meteoroid

Hi!! Can someone please help me alter this formula. I keep getting 'malformed IF statement' when I input this formula into a large WF: 'IF [Value] > ABS(580000) THEN "Tested XXX" ELSE Null() ENDIF

 

7 REPLIES 7
AGilbert
11 - Bolide

It could be that the data type of [value] is not numeric and therefore cannot be compared to a numeric value. It would be helpful if you can share a screenshot of the errors you're getting. 

jlaurenn11
6 - Meteoroid

Hi! thanks for reaching out the error is 'Parse Error at char (12) : Invalid type in operator >. (Expression #1)

usmanbashir
11 - Bolide

@jlaurenn11 - Can you try adding in a Select tool before the Formula tool and updating your [Value] field to Double or Integer (whichever numeric data type that field is)? Hope this helps!

AGilbert
11 - Bolide

What is the datatype of the Value field?

 

See the attached workflow for the difference in how that expression works with a string vs an int datatype. 

 

Screenshot 2024-05-01 102244.png

jlaurenn11
6 - Meteoroid

@usmanbashir 

@AGilbert

 

I went ahead and added the 'Select' tool to then make 'value' an Integer but now I have an error warning on my 'Cross Tab' function saying 'The crosstab was set up for a Numeric field type and String field was found.' Could you please help me with this?

 

AGilbert
11 - Bolide

I wish I had a technical answer for why you're seeing this error but all I have is that some tools seem to be 'sticky'. In other words, they seem to remember the previous configuration of the data received from the upstream workflow. This is common with the transform tools.

 

I hate to say the equivalent of "turn it off and back on" but you could delete the cross tab tool and replace it with a new one, reconfigure it the same way (with value as a new datatype), and it shouldn't have a problem. 

 

Remember that these are workflows. If you change something upstream (like a datatype of an existing field or removing a field altogether) it will impact everything downstream. 

jlaurenn11
6 - Meteoroid

Thank you so much, reconfiguring the tool worked and now it is running smoothly !

Labels