2 Replies Latest reply on Sep 21, 2012 2:25 PM by T M

    How to convert String Exp to Date field

    T M

      Hi All,

       

      I have a data source from which the date field(VIEW_DATE) is being populated as a string/text in the dimensions. I want to convert it into a Date field that can be recognized by Tableau.

      I don't see the Option for Change Data type when I right click on the VIEW_DATE field.

       

      Hence, I am trying to create a calculated field using Date function (DATE([VIEW_DATE]) but am getting the below error  -

       

      All field must be aggregate or constant when using table calculation functions or fields from multiple data sources.

       

      I also tried using

      DATE(

      MID([VIEW_DATE],5, 2) +

      "-" +

      RIGHT([VIEW_DATE], 2) +

      "-" +

      LEFT([VIEW_DATE], 4)

      )

       

      but get the same error.

       

      Can someone please help me resolve this issue? Any help would be much appreciated.

       

      PS : Attached a screenshot for reference, as cannot share the workbook since I'm connecting to the data Live