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

Date Format Overwrite

jmmart08
8 - Asteroid

Hi All

 

I am having trouble finding a solution to change the date format within my workflow.  I have a flow built where the end result is comparing records 1 to 1 for ANY differences.  My outputs are from 2 different systems, which 1 is pulling in a .txt file and converting to .csv and the other is a .xlsx output.  Using January 15, 2020 as an example, 1 output shows the date as 2020/01/15 and the other output shows the date as 2020-01-15.  At the end of my workflow, my TRUE output is showing differences due to the format difference.  Is there any way to use the DateTime tool to just REPLACE the existing data or do you have to add a new column? 

 

Also maybe I can change my workflow in some way so that format difference doesn't come up as a difference?  The "difference" formula I have is IF [Sheet1_Value=[Sheet2_Value] THEN "No Difference" ELSE "Difference" ENDIF.

 

Any suggestions would be very much appreciated!!!

 

Thanks!

4 REPLIES 4
Hugo
9 - Comet

Hi Jmmart08

 

It would seem that both of your dates are currently string fields? You can change your difference formula to be

 

If DateTimeParse([Sheet1Data],"%Y/%m/%d") = DateTimeParse([Sheet2Data],"%Y-%m-%d")

Then 'No Diff'

Else 'Diff'

Endif

 

This will parse both strings as dates and compare them within the formula

Alternatively you can use the datatimeparse formula to make new fields with a date format, and compare them. That is essentially what the above formula is doing, but separating it out may make it easier to troubleshoot.

 

 

ups366
8 - Asteroid

Hi,@jmmart08 

 

Like this ,

d2.png

jmmart08
8 - Asteroid

Hi Hugo

 

Absolutely amazing.  Thank you VERY much for this formula.  Worked perfectly in my workflow!

jmmart08
8 - Asteroid

Hi ups366,

 

Awesome!  This formula worked for me as well!  Very much appreciated.

Labels