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:

Example:

Outage Start:       Outage End: 
1452005400          1,452,011,400

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?

Answers


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.

Tableau Screenshot of EPOCH time format conversion

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).

Post Status

Asked in February 2016
Viewed 1,290 times
Voted 12
Answered 1 times

Search




Leave an answer