KNOWLEDGE BASE

How to convert "hh:mm" data to decimal values.


Published: 23 Nov 2022
Last Modified Date: 24 Nov 2022

Question

How to convert "hh:mm" data to decimal values.
User-added image

 

Environment

  • Tableau Desktop

Answer

1. Connect to the attached data source.
2. Create a new calculated field as following.
     Name : Convert to decimal value
     Calculation : (DATEPART('hour',[Time])*60+DATEPART('minute',[Time])) / 60
3. Right click and drag [time] to Rows -> Select [time (discrete)].
4. Right click and drag [Convert to decimal value] to Text on Marks -> Select [SUM (Convert to decimal value)].
 
Did this article resolve the issue?