Alteryx Designer Desktop Discussions

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

"Text" is not a valid Date in Formula Tool

tf05
7 - Meteor

I have written a formula which need to return 'No Call' if no date is present. 

 

IF IsEmpty([Call Date]) THEN "No Call"
ELSE [Call Date]
ENDIF

 

Although I get an error as 'No Call' is obviously not a data format.

 

How can I alter the formula or use a different method to achieve the output required?

 

Thanks

3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @tf05 

 

Use a select tool and convert it to v_string then it will support like below

 

atcodedog05_0-1646236726098.png

 

Hope this helps : )

 

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @tf05 

Cheers and have a nice day!

RolandSchubert
16 - Nebula
16 - Nebula

Hi @tf05 ,

 

I guess, [Call Date] has the data type "Date" or "DateTime", your formula tries to insert a string in this field - of course this is not possible.

 

An option colud be to create an additional field with a string data type (e.g. V_String) and calculate this new field
IF IsEmpty([Call Date]) THEN
     'No Call"
ELSE
     DateTimeFormat([CallDate], '%Y-%m-%d')
ENDIF

Drawback is - the new field isn't a date field any longer, you can't perform DateTime functions (e.g. calculate difference in days) without converting it to a date datatype again.

 

What do you think - could that be a solution?

 

Best,

 

Roland

Labels