3

In the Tableau, I have a column containing the timestamps in unix-time format, which I wish to convert it to Human time. Is it possible to use R script in Calculated Field for such time conversion?

Tableau screenshot

ARASH
  • 418
  • 2
  • 6
  • 18

1 Answers1

8

I think you should create a new calculated field like this:

New_date = dateadd('second',[Time],#1970-01-01#)

Or if [Time] is in milliseconds then just divide it by 1000 to convert to seconds before passing it to dateadd of course

Alex Blakemore
  • 11,301
  • 2
  • 26
  • 49
  • thanks! your solution worked well. But still wondering why New_date=DATE(DATEADD('second', [Time], #1970-01-01#)) didn't work when connecting to **mysql** (adding **DATE** function at the beginning), but when connecting to **csv**, or **xlsx** it worked! – ARASH Sep 15 '16 at 02:49