How to find difference between time in seconds
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I tried to find difference between time in seconds but unable to. Could you please suggest what should be the best way to find difference.
I was using DateTimeDiff() function.
Regards,
Solved! Go to Solution.
- Labels:
- Date Time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
eg.
datetimediff([StartTime],[EndTime],"seconds")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Oops looks like I replied to a new thread (perhaps @TaraM can merge?)
Anyway I think you can't do this on Time variables, just datetime. So I used DateTimeToday() to add a date and converted them. See attached. Slightly more tools than you'd want but it works.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Sorry, I didn't understand the solution.
You mean to say that If we add DateTimeToday() as prefix for Start and End time, DateTimeDiff(,,) should work.
And, if the date changes, does the same logic work? e.g. Start time is 23:50:00 hrs and End time is 00:40:00.
Could you please share modified workflow.
Need your support on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You only had times in your workflow, therefore I added todays date (it oculd have been any date) to turn it into a datetime. Did you see my module attachment at the bottom of my last post?
In terms of whether the date changes then you could amend the logic to add 1 to the day if the end date is less than the start date, but can you not capute the date of the occurence and solve this properly, then Alteryx will handle it.
in summary Alteryx requires a date and a time to calculate a difference.
Hope that is clearer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks Chris,
But last attachement seems to have no DateTimeToday() function used. Might be I am missing something.
Anyway, thanks for support.
- AB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
:) Wonderful.
Thank you very much for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
No problem, glad we got there in the end!
