Hi All,
I'm a newbie to Alteryx so please bear with me if this is has an obvious answer.
I'm trying to convert a set of values (ages) into defined groupings using the Formula tool (code I've written is copied below). The output is a new column rather than changing the existing Metadata.
I'm being given an error that reads "Parse error at char (0): invalid type in operator >. (Expression #1). The first "If" in red below is being underlined in the formula window.
IF [16. Age] < "25" && [16. Age]>= "18" Then "18 to 24"
ELSEIF [16. Age] > "24" && [16. Age] < "35" then "25 to 34"
ELSEIF [16. Age] > "34" && [16. Age] < "45" then "35 to 44"
elseif [16. Age] > 44 && [16. Age] < 55 then "45 to 54"
ELSEIF [16. Age] > 54 && [16. Age] < 65 then "55 to 64"
ELSEIF [16. Age] > 64 then "65+"
ELSE "#N/A"
ENDIF
Essentially what I want to do is for a column to be inserted that enters a group name related to an age (i.e. 24 would equal "18 to 24").
I'm sure it's something fairly simple and obvious that I'm missing but any help that can be offered to a newbie would be much appreciated.
Solved! Go to Solution.
Hi @dbyfield,
Presuming your [16. Age] field is a number (Int, Double etc...) then you don't need the " " around the numbers (those are for string types only) hence the error
Ah I see! the Age fields was set to Vstring but as soon as changed to Int16 and removed the quotation marks and the error went away.
Thanks very much for your help!
I have same issue I did the same, but I still see the same error
Hi @shai
What error are you seeing?
Also if you could post the formula I may be able to assist.
thanks