Last Modified Date: 24 Jan 2017
- Tableau Desktop
- Cloudera Hadoop Hive
Option 1Change the field back to a String in Tableau Desktop and create a calculated field to manually to convert it to a datetime value.
Option 2Separate the date field from the Hour, Minute, and Second field; then combine them back into a unified date time. The calculated fields may have to be altered slightly to take into account the string format.
- Base Date
DATE(LEFT([Datetime],10))Take the M/D/Y and cast as a Date.
INT(MID([Datetime],11,3))Find the HH value and cast as an Integer.
INT(MID([Datetime],15,2))Find the MM value and cast as and Integer.
INT(MID([Datetime],18,2))Find the SS value and cast as an Integer.
Date Time Field DATEADD( 'hour', [Hour], DATEADD( 'minute', [Minute], DATEADD( 'second', [Second], [Date Calc])))
CauseThe data source is queried with a
Additional InformationThe starting point for the MID argument will need adjusting in order to accommodate a different string length. The easiest way to understand this is to remove the INT section, and observe where the data string is starting.
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Training and Tutorials