1 Reply Latest reply on Dec 3, 2018 3:21 PM by Hari Ankem

    Inconsistent date format in one date field

    baron li



      I have some student application data and the inconsistent date format seems to have an impact on my Tableau.


      For student apply for 2019 course, the date type is  Day/Month/Year HH:MM:SS  (like 21/12/2018 13:01:01)


      For 2018, the date type is simply 2016-08-13 (Year-Month-Day)


      So the data set is like this:



      Course year                       Application Date

        2019                              21/12/2018 13:01:01

        2018                                     2016-08-13


      The impact is that I found after creating extract and publish the dashboard, the Couser Year 2019 has no informaiton --- applicate date is 'Null' in 2019.

        • 1. Re: Inconsistent date format in one date field
          Hari Ankem

          You should change the data type of the original Application Date to a string, and then create the calculated field as shown below. You could then replace all old references of the Application Date with the new calculated field.



          CASE [Course year]

              WHEN 2018 THEN DATEPARSE("yyyy-MM-dd",[Application Date])

              WHEN 2019 THEN DATEPARSE("dd/MM/yyyy hh:mm:ss",[Application Date])



          Hope this helps.