Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

how to convert 1/0/1900 date to 0

kamranyousaf
6 - Meteoroid

Hi, I am a new user of Alteryx and having issue with the data output. if there is blank field in date field then I get the output as '1/0/1900' and I would like to replace it with 0. I'm getting the "invalid type in operator ==" error for the following formula. I'm not sure what isn't correct about the way it's written.

 

if ([_CurrentField_]) = "01/00/1900" then 0 ELSE ([_CurrentField_]) endif

 

i am using multi field formula since i have more than 1 field having date with the same issue. 

13 REPLIES 13
Qiu
21 - Polaris
21 - Polaris

@kamranyousaf 
Can you try to remove the double quotation for "01/00/1900", since it is date type data, not string.

Hi @kamranyousaf 

 

Will you be able to send a screenshot of how the tool was configured, on your end? I created something similar and this is how it looks like for me. Cheers!

 

christine_assaad_0-1604965856799.png

 

kamranyousaf
6 - Meteoroid

when I removed the quotation, i get the parsing error

 

kamranyousaf_0-1605034217926.png

 

kamranyousaf
6 - Meteoroid

please see below

 

kamranyousaf_0-1605034553090.png

 

kamranyousaf
6 - Meteoroid

Christine, since my workflow is quite long, i created a short work flow using a sample of the same data that feeding into the formula to share with you (see attached below). you will see that input data has 1/0/1900 as date that I want to replace with 0. But with this multi row formula its converting it into something else. 

@kamranyousaf , Thanks! 

 

I can't access however your input data. Could you please send the workflow packaged (Options --> export WF and then include the xlsx as asset)? Or you can send it separately as well.

kamranyousaf
6 - Meteoroid

please see attached below.

Hi @kamranyousaf 

 

I only see 1899-12-30. I assume this is what you need to replace. It's read as date so I converted it to string to be able to replace it with 0.

 

Check the attached and let me know if it works.

kamranyousaf
6 - Meteoroid

Hi Christine,

 

Thank you ! it works. the only issue i have now is that it changed the dates to a different format i.e. from (mm/dd/yyyy) to (yyyy-mm-dd).  

 

Labels
Top Solution Authors