ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Date/Time Combination and DateTimeDiff to be Returned as Time

RSchomer
7 - Meteor

Working with date and time in Altyerx has proven to be much more difficult than I had originally anticipated.  I have a data set which is returned to me with date and time in two separate fields.  I have two problems I'm trying to tackle and need some assistance.

 

First, I need to combine the date and time fields into one (the time field is also an integer, not time... solved here), and second I need to subtract time (in whole minutes) from the resulting field to return a time value.  I also need to account for possible null date and time values.  

 

This is pretty much what the incoming data set will look like (if there's a date, there will always be a time; but not always a brief):

DateTimeBrief
2017-09-01 00:00:0070060
2017-09-01 00:00:00165090
[Null][Null][Null]
2017-09-01 00:00:0091530
2017-09-01 00:00:001530
2017-09-01 00:00:001130[Null]

 

And this is what I want returned in the Report field (Date + Time - Brief):

DateTimeBriefReport
2017-09-01 00:00:00700602017-09-01 06:00:00
2017-09-01 00:00:001650902017-09-01 15:20:00
[Null][Null][Null][Null]
2017-09-01 00:00:00915302017-09-01 08:45:00
2017-09-01 00:00:0015302017-08-31 23:45:00
2017-09-01 00:00:001130[Null]2017-09-01 11:30:00

 

Any help for an Alteryx newbie?

2 REPLIES 2
pcatterson
11 - Bolide

Familiarize yourself with the DateTime functions, they are great.  Here is my approach.

RSchomer
7 - Meteor

I must've tried a hundred different variations of formulas before you sent that workflow.  Having the Report field type set to a string looks like it made all the difference.  I kept trying to convert it to a datetime or a double with varying unsatisfactory results.  But this workflow helped explain a lot of the little things I was missing.  

Labels
Top Solution Authors