0 votes
1 view
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
0 votes
1 answer
asked Oct 10 in BI by dev_sk2311 (13.4k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...