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?
Asked
Active
Viewed 1.0k times
3
-
No need to use R for this, call dateadd() – Alex Blakemore Jul 27 '16 at 03:54
1 Answers
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

Edwin Isensee
- 81
- 1
-
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