I have a if formula IF [ID]=[id] THEN [DATE]+1 ELSE "" ENDIF
date is formatted 2020-05-20 00:00:00
what I would want ID=ID then date =2020-05-21 00:00:00
the error message I get is Formula (25) Parse Error at char(0): Type mismatch in operator +. (Expression #1)
Solved! Go to Solution.
Hey @Primus
The key here is that in order to add dates, you must use the DateTimeAdd() function!
So long as your field is recognized as a date, you should be able to use this expression:
IF [ID]=[id] THEN DateTimeAdd([DATE],1,"days") ELSE "" ENDIF
Hope this helps!
Hi @Primus
In Alteryx, you need to use the DateTimeAdd formula to add or subtract from a date - the error you are getting is because you are adding a number to a date, which are different data types in Alteryx.
Try DateTimeAdd([DATE], 1, "days")
This is a common new thing to get used to for people transitioning from Excel and similar programmes. I would recommend looking through the relevant interactive lesson here: https://community.alteryx.com/t5/Interactive-Lessons/DateTime-Functions/ta-p/98952
You can read the documentation on the different DateTime functions here: https://help.alteryx.com/10.1/Reference/DateTimeFunctions.htm
User | Count |
---|---|
18 | |
15 | |
13 | |
9 | |
8 |