ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Today,s date in formula

jeetamar11
Meteoro

I am struggling with usage of datetimetoday() function in formula. I have a column name 'case create'- i need to replace all the dates with today's date and blanks with a string " No case" in that column. I keep getting error that says Unmatched or parse.

please help!

7 RESPUESTAS 7
ed_hayter
Púlsar

you could wrap your datetimnetoday() in tostring

 

if isempty([date]) then "no case" else tostring(datetimetoday()) ENDIF

JamesCharnley
Púlsar

Hi @jeetamar11 

 

If you want one column with today's date or 'No case' then the column will need to be a string, whereas DateTimeToday is going to return a date. I think wrapping it in ToString() as part of your formula should work.

jeetamar11
Meteoro

Column name needs to be same as it is. i just need to replace the data that has today's date, with a string "No case". The data in the column is datetime type

alexnajm
19 - Altair
19 - Altair

You cannot store "No case" in a column that is a Date data type - it will have to be a String data type in that scenario.

JamesCharnley
Púlsar

You won't be able to keep the datetime data type if you want a string value of 'No Case'. You will need to create a new string column and rename it to the same name later

NMangera
Bólido

@jeetamar11 

 

if you'd like to display 'No Case' the data type needs to be a string, which means no date functions downstream in the workflow. To replace all the dates with today's date and blanks to 'No Case' the formula tool would look something like the screenshot

 

converttodaysdate&blankstoNoCase.png

jeetamar11
Meteoro

Thank you, great help!

Etiquetas
Autores con mayor cantidad de soluciones