Alteryx Designer Desktop Discussions

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

Date Time Formation

Timo97
7 - Meteor

Hello everybody,

i have a strange data format for dates, it is looking like this 10-JAN-20 but of cause this dosent work with Alteryx DateTimeDiff(dt1,dt2,u) function.

 

Would be really nice if someone could help me to transform this into somethink that work.

 

Thanks a lot 

Timo 

8 REPLIES 8
atcodedog05
22 - Nova
22 - Nova

Hi @Timo97 

 

Here is how you can do it.

 

Formula:

DateTimeDiff(
DateTimeParse([Date 2],"%d-%b-%y"),
DateTimeParse([Date 1],"%d-%b-%y"),
"days")


Workflow:

atcodedog05_0-1632158788448.png

 

Hope this helps : )

Luke_C
17 - Castor

To add to @atcodedog05 's great solution, I suggest saving the below page. It's a good reference for the different syntax and specifiers used in date time functions.

 

DateTime Functions | Alteryx Help

Timo97
7 - Meteor

Thanks a lot @atcodedog05 and @Luke_C for this massive help.
Now there is another problem that my data language is different then my Alteryx language can i change this just for this function ? 
probably not i guess...

atcodedog05
22 - Nova
22 - Nova

Hi @Timo97 

 

Date format is only changing within the formula. Its not changing the actual data itself your actual data will stay the same.

Timo97
7 - Meteor

What i mean@atcodedog05 is that my data language is different than english so the function does not recognise the Months...

 

atcodedog05
22 - Nova
22 - Nova

Hi @Timo97 

 

If i understand correctly if you are saying your month naming convention is different then it wont work. You would need to use find and replace to replace other language month name to English month name.

Timo97
7 - Meteor

That is exactly what i mean

 

Thanks you very much @atcodedog05 🙂 

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @Timo97 

If my response helps please don't forget to mark it as solution.

Cheers and have a nice day!

Labels