3 Replies Latest reply on Dec 13, 2016 7:31 AM by Andrew Watson

# Adding up Interval Time (tableau error)

Hello Tableau users,

I'm getting an error in Tableau. I have to add up the total time duration of hours:mins:secs. The Field in database is INTERVAL TYPE but in tableau it came in as STRING, when i have asked my ETL developer he has asked me to SUM up the column but when I convert the field into number and use it in the sheet. I have been getting an error i have attached an screenshot. is there any other work around to sum the INTERVAL time.

Thanks

• ###### 1. Re: Adding up Interval Time (tableau error)

Summing time is possible in Tableau, there are a few approaches. This link will show you one of them: Re: Using Time (Hours, Minutes, Seconds) as a Measure

There isn't a clean way to do this but converting all of your time periods into seconds, then summing, then allows you to mathematically convert the summed seconds back to hours, mins and seconds.

• ###### 2. Re: Adding up Interval Time (tableau error)

Andrew Watson thanks for the reply Andrew, but I want to calculate the difference of hours, mins and secs between two fields and then up the hours & mins & secs.. that was were i was running into problems. The two fields were ( [Evnt End Time] - [Evnt Start Time] ) if you can please assist me how to calculate the difference and how to add up the hours, mins and secs would be appreciated .

Thank you

• ###### 3. Re: Adding up Interval Time (tableau error)

Can you Datediff to find out the number of seconds difference, then do a calculation to convert the seconds back to hours, mins and seconds?

DATEDIFF('second',[Evnt Start Time], [Evnt End Time]) to get the difference in seconds.

This link shows how to convert the seconds to hours, mins and seconds: Converting Seconds to HH:MM:SS or DD:HH:MM:SS | Tableau Software