Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (17.6k points)

In Tableau Desktop, I've got two date dimensions representing the beginning date and the end date of an event. To know the duration of an event, I do DATEDIFF('second', [begin date], [end date]).

Unfortunately, some events last less than one second so there are many zero length durations.

How can I get more precision (milliseconds would be fine)?

My data source is an Excel file.

1 Answer

0 votes
by (47.2k points)

Follow the steps given below:

  1. define the column as float

  2. subtract the float dates as you need to in a calculated field

  3. now you have the difference as a decimal in days, if you want to get it down to milliseconds, you do [floatdate] * 24 * 60 * 60

If you need the column in a proper date format as well, you can just copy it with a calculated field in another column and define that as a date.

Related questions

0 votes
1 answer
asked Dec 9, 2020 in BI by Chris (11.1k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...