Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Identify Actual Date Data

Johmz
8 - Asteroid

I need help creating workflow identifying if the data provided is actual Date if not consider as false information.  Thanks in advance

9 REPLIES 9
cjaneczko
13 - Pulsar

Can you provide an example? Not sure what you  mean.

aatalai
14 - Magnetar

@Johmz initial guess would be use the directory tool as that will provide information like file path, dates relating to creation (from memory) and that might have the information you would need.

 

But if not like @cjaneczko more information would help

Johmz
8 - Asteroid
DATAIs it Date
11/23/202311/23/2023
BrittanyFalse Information
New YorlFalse Information
01/07/202401/07/2024
cjaneczko
13 - Pulsar

Something like this will work in a formula tool.

 

 

 

if isnull(DateTimeParse([DATA],'%m/%d/%Y')) then 'False Information' else datetimeformat(DateTimeParse([DATA],'%m/%d/%Y'),'%m/%d/%Y') endif

 

 

image.pngimage.png

Johmz
8 - Asteroid

thanks for helping. This workflow will help me to complete my project. 

Johmz
8 - Asteroid

Hi @cjaneczko 

 

I have changes to workflow that if the DATA is Actual Date the result should be True Data. I tried to changed the syntax but i not the actual result.. 

cjaneczko
13 - Pulsar

So instead of the date showing you just want the it to say 'True Data' in text? Altering the formula to the below should do that.

 

if isnull(DateTimeParse([DATA],'%m/%d/%Y')) then 'False Information' else 'True Data' endif

 

cjaneczko
13 - Pulsar

Actually dont use the above. It can lead to false positives. Try the following in a formula tool instead.

 

IF regex_match([DATA],"[01]{0,1}\d\/[0-3]*\d\/20\d{2}") then 'True Date' else 'False Information' endif

image.pngimage.png

Johmz
8 - Asteroid

It's now working. Thanks for the help. much appreciated

Labels