Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Formula to keep field empty, and if not empty, display today's date

malcorr
8 - Asteroid

Hello, 

 

i have a field in which, if it comes empty from the input file, i want to keep it empty, and if its not empty, i want to display today's date in that same field (Lets call the field "Date")

 

Any ideas? i think it should be easy, tried using the below in a "Formula" Tool but it says the IF is malformed. 

 

IF IsNull([Date]) THEN "" ELSE ToString(DateTimeToday())

2 REPLIES 2
rzdodson
12 - Quasar

@malcorr try this in a Formula tool.

 

 

 

If IsEmpty([Date]) then [Date]
else DateTimeToday()
endif

 

 

Edit:

The solution above assumes that your Date field is already in a Date format.

 

malcorr
8 - Asteroid

Thank you! this worked, and yes, the field was already in a date format

Labels