How to calculate fraction in datediff function in Tableau
<p>I am not really an expert in Tableau. I have a need to calculate a timedifference in hours, but also want to see fraction of an hour. I am using Tableau 9.</p>

<p>I used the function
IF DATEDIFF("hour", [CL2_Start_Time_ST], [CL2_End_Time_ST]) > 8 then NULL
ELSE DATEDIFF("hour", [CL2_Start_Time_ST], [CL2_End_Time_ST])
END</p>

<p>If the time difference between CL2_Start_Time_ST and CL2_End_Time_ST is less than 1 hour (for example 30 minutes) the result is 0, but I want to see 0.5 in result.</p>

<p>I dont want to calculate in time difference in minutes since all my other calculations are in hours and hence it is easier to create a relative plot with other calculations.</p>

<p>Please help.</p>