Transforming 6 digit integer to a date when bad values are involved
I have a dataset with chunks of bad data in it. To get a MFG date I pulled the first 6 digits of the serial # to get a "date" in an text format.
if the data is correct it should read out the correct date, but in some cases the data will have 06B378 or other letters or texts that should not be in there. How would I go about excluding the bad data as well as converting the good 6 digit data into a date format?
Let me know your thoughts or how I go about this. I tried to alter columns to integers and inherit bad values as null but it seems to not be catching all bad values.
Thanks
Answers
-
Hi @gbrown ,
So you're going to go have to do 2 steps:
1) Determine which cells are truly numeric
2) Convert the numeric ones to dates
Here are the formulas to do the steps:
1) CASE
WHEN STR_REMOVE_DIGITS(`Date_Temp`)='' THEN 1 END
2) CASE
WHEN `Numeric Format Flag`=1
THEN CAST(CONCAT('20',RIGHT(`Date_Temp`,2),'-',left(`Date_Temp`,2),'-',SUBSTRING(`Date_Temp`,3,2)) as date)
END
Even better! Here's a video of me explaing what all this mumbo jumbo is: https://www.loom.com/share/ebf8d97b0ec94d458b6d09813dc93e2c
Hope that helps,
John Le
More video solutions at https://www.dashboarddudes.com/pantry
John Le
Let me make you the me of your organization for Domo
Click here for more video solutions:
1
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive