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):
Date | Time | Brief |
2017-09-01 00:00:00 | 700 | 60 |
2017-09-01 00:00:00 | 1650 | 90 |
[Null] | [Null] | [Null] |
2017-09-01 00:00:00 | 915 | 30 |
2017-09-01 00:00:00 | 15 | 30 |
2017-09-01 00:00:00 | 1130 | [Null] |
And this is what I want returned in the Report field (Date + Time - Brief):
Date | Time | Brief | Report |
2017-09-01 00:00:00 | 700 | 60 | 2017-09-01 06:00:00 |
2017-09-01 00:00:00 | 1650 | 90 | 2017-09-01 15:20:00 |
[Null] | [Null] | [Null] | [Null] |
2017-09-01 00:00:00 | 915 | 30 | 2017-09-01 08:45:00 |
2017-09-01 00:00:00 | 15 | 30 | 2017-08-31 23:45:00 |
2017-09-01 00:00:00 | 1130 | [Null] | 2017-09-01 11:30:00 |
Any help for an Alteryx newbie?
Solved! Go to Solution.
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.