Datefield recognized as text

Reply
Yellow Belt

Datefield recognized as text

Is there a way to view the faulty date which is actually seen as text? Because I can't just check them all by hand.

Thanks in advance

Black Belt

Hi @user046467 

You could spin up a magic ETL and attempt to convert the data type to a date (using Alter Columns tile in Magic 2.0 or Data Type(?) in 1.0). When you run the preview it'll state which value it wasn't able to convert to a date.

 

Alternatively you could utilize a replace text field with a regular expression to change the text to a value if it passes and filter for rows which don't have the set value.

 

A simpler (but maybe less reliable) check would be to check to see if the length of your field is 10 characters or not (assuming YYYY-MM-DD type format - 8 digits, 2 separator characters) in a beast mode on a table card and then filter for records which don't have 10 digits.



**Was this post helpful? Click the heart icon**

**Did this solve your problem? Accept it as a solution!**
Black Belt

as an extension to @GrantSmith 's idea, 

 

on your input tile in Magic 2.0 you can set the desired data type (instead of using an ALTER tile).  you can also build in error handling that says 'if the column cannot be converted to date replace with a NULL value.  You could then output rows where the date column is NULL as a dataset.  

 

it's a bit of a pain to have a dataset with a null date column, so maybe add a ROW_ID so you at least know which row of your raw dataset it was.  

 

i like your regex idea Grant!  except i hate regex with a passion 😛


Jae Wilson
Check out my Domo Training YouTube Channel

**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"
Announcements
New & Improved Dojo: Get excited for a new feel and additional features in the online community.

Site will be down February 4-5th for maintenance.

Launch coming February 8th!