5 Replies Latest reply on Sep 1, 2018 8:27 PM by Shinichiro Murakami

# Tableau Date Difference and Total time difference

Hey there,

I am trying to solve Date diff and time diff in tableau. I am trying to show the difference between two time periods and also the sum total of time columns.

I tried to do with date diff but I am not getting accurate values. Can some one help me with this. Attached sample data with calculations.

• ###### 1. Re: Tableau Date Difference and Total time difference

Same as Excel, 24hours=1 day = 1

And hours, minutes, second ... is handled as decimal numbers.

From conclusion, it is always better calculation first and change the format.

Datediff => minute only brings "mitnues"' part diff and ignoring "second" which makes gap.

The diffrentce from excel is

Tableau does not have capability to show only time part, it always comes with "datetime" starting from 1899/12/30.

Excel allows "1900/1/0".

Educational Brain Teaser (Answer for Time Duration Calc) : Graph of "Time" replicates Excel (Easy?)

Educational Brain Teaser（Answer Part I) : Graph of "Time" replicates Excel (Easy?)

Thanks,

Shin

• ###### 2. Re: Tableau Date Difference and Total time difference

Hey Shin,

I am getting these date diff values for these two columns( Start and exit) but need to calculate  between all four columns in the data as explained in the excel and need to sum these time differences based on each user.

D3-C2

D4-E3

D5-E4

• ###### 3. Re: Tableau Date Difference and Total time difference

Hi Laxmi

I attached the final product (which I think close) but it too heavy duty for me to instruct everything here.

I don't think it's fair to ask handling this level of complicated task on this forum.

Thanks,

Shin

1 of 1 people found this helpful
• ###### 4. Re: Tableau Date Difference and Total time difference

okay Thank you Shin. Finally one question what is this displayfilter for window_sum.Is there any calculated field?

• ###### 5. Re: Tableau Date Difference and Total time difference

When you remove it, you can understand the function.

Please check attached workbook in detail.