Hi guys,
I've been trying to get this if statement to work in the formula tool. Please let me know what I'm doing wrong. Alteryx keeps saying "malformed if".
IF [Date] >= 01/01/2020 and [Date] < 04/01/2020 THEN "Quarter 1"
ELSEIF
[Date] >= 04/01/2020 and [Date] < 07/01/2020 Then "Quarter 2"
ELSEIF
[Date] >= 07/01/2020 and [Date] < 10/01/2020 Then "Quarter 3"
ELSE
"Quarter 4"
END IF
Solved! Go to Solution.
Hi @davidogundipe — Two things to fix in your formula express:
1) Put the dates in " " (quotes or double quotes) and hope your [Date] field is in proper DATE datatype
2) remove space between "END IF" so write it like "ENDIF"
Thank you!
IF [Date] >= "01/01/2020" and [Date] < "04/01/2020" THEN
"Quarter 1"
ELSEIF [Date] >= "04/01/2020" and [Date] < "07/01/2020" Then
"Quarter 2"
ELSEIF [Date] >= "07/01/2020" and [Date] < "10/01/2020" Then
"Quarter 3"
ELSE
"Quarter 4"
ENDIF
@davidogundipe — Thank you!
@davidogundipe
Just to add to @vizAlter comments, the date as criteria has to be Alteryx Standard Format yyyy-mm-dd.