aiapps February 2016
Tableau how to convert a dimension into a datetime
I'm using Tableau 9.0, I am trying to calculate service outage time. I have 2 dimensions to work with -start time and an end time. When I look at the values they are in this format:
Outage Start: Outage End:
Ideally I'd like to convert the current format to a datetime so that I work with it to find the outage time down to seconds.
Does any one know how I might go about this?
Petr Havlík February 2016
Depending on what EPOCH format you use, this formula will do the trick:
DATEADD('second', [EPOCH FORMAT TIME], DATE('1/1/1970'))
For your example value of 1452011400 will return Jan 5, 2016 - 4.30pm.
Keep in mind there are two EPOCH formats, so make sure you use the correct one: The Unix epoch is typically 1/1/1970, while the Microsoft COM epoch is 12/30/1899.
I have used Unix format in my example above (the last argument to DATEADD funciton).
Asked in February 2016
Viewed 1,290 times
Answered 1 times
Leave an answer
Quote of the day: live life