Hello,
I'm trying to run the following conditional expression with dates but this error occurs.
Thank you.
Solved! Go to Solution.
Hi @BautistaC888 ,
What's the data type of the field [Start_Date]? Is it a string?
Dates in Alteryx should have a specific format of yyyy-mm-dd.
If you also want to apply operators on dates, you should first convert your Start_Date field into a Date data type (you can do that with a DateTime tool).
Then your formula tool should slightly change to accommodate the changes in the DateFormat. You should use something in the lines of
IF [Start_Date_Converted]<="2021-01-31" THEN "2021-01-31" ELSE [Start_Date_Converted]
ENDIF
where [Start_Date_Converted] is your Start Date in a format that alteryx can understand as a date.
I have attached a workflow as an example.
Hope that helps,
Angelos
Hi Emil,
Still happened
You should also add your fields in quotation marks, so your expression should be
IF [Start_Date]<="31/1/2021" ...
but still this won't give you what you are looking for as Alteryx is treating "31/1/2021" as a string and cannot understand what you mean by typing <=, unless you first convert it to a date data type (see my previous post for more details)
First, you can only compare dates that are written in date format (YYYY-MM-DD). So your condition should be [Start_Date] <= '2021-01-31'.
Second, you don't need to call the field name again to insert the true result. You just need to make sure you have selected the field in the Output Column.
User | Count |
---|---|
18 | |
14 | |
13 | |
9 | |
8 |