I want to have a column with 1 or 0 depending on if a date based on another column falls within a certain range. How would I write the formula. I tried the following but I know it's not right as its not reading the dates as dates. [Consent Date] is in DateTime format.
IF([Consent Date]) > 2020-12-31 AND < 2021-05-01 THEN 1 ELSE 0 ENDIF
Solved! Go to Solution.
Dates have to be in quotes.
IF([Consent Date]) > "2020-12-31" AND < "2021-05-01" THEN 1 ELSE 0 ENDIF
This assumes [Consent Date] is an Alteryx Date. If not - try date/time first. or post how your date is set up and I'll edit the above with a solution specific to your current date formatting.
Hey @EscapedGoat
Cool name btw!
I've attached a workflow that does this, you were so close with the formula!
i used:
IIF([Consent Date] > "2020-12-31" AND [Consent Date] < "2021-05-01", 1,2)
Hope this helps!
TheOC
Thank you! This worked 😊