3 Replies Latest reply on Oct 5, 2016 5:49 PM by Doug Stanley

    Help with dateparse, please?

    Doug Stanley

      I have data with a string date value in this format: '2006 Q4'. I need to convert this to a real date, e.g. 10/1/2006 so I can use Tableau's date functionality, etc.

       

      I have tried approaches described in two separate forum threads -- here and here -- but neither is working for me and I can't figure out why.

       

      I've tried this: DATEPARSE("yyyy QQ",(Right([Date],7)))

       

      And I've tried this:

      if ENDSWITH([Date],"1") THEN DATE("01/01"+LEFT([Date],4))

      ELSEIF ENDSWITH([Date],"2") THEN DATE("01/04"+LEFT([Date],4))

      ELSEIF ENDSWITH([Date],"3") THEN DATE("01/07"+LEFT([Date],4))

      ELSEIF ENDSWITH([Date],"4") THEN DATE("01/10"+LEFT([Date],4))

       

      END

       

      Can someone spot what I'm doing wrong? Thanks in advance. (Workbook in ver. 9.3 attached)