Skip to main content

For whatever reason (most likely because of the architects), we have a database that outputs Fiscal Year/Period (Month) as a Number.  For example, 2017001, and when converted to a string is looks like 2017/001.  To make things worse is has that extra 0 between the year and the month.  Once extracted and linked to Tableau I have been unable to change this format to a date format.  My desired end result is this:  January 2017. 

 

To start, I've tried these methods with no success.  I end up with Null values.

 

1.  DATEPARSE("YYYYMMM",[Fiscal Year/Period])

 

2.  DATEPARSE('YYYYmmm',[Fiscal Year/Period])

 

3.  DATE(RIGHT([Fiscal Year/Period],3)+(LEFT([Fiscal Year/Period],4)))

 

Changing date format from Number to String to Date

Any help on this would be greatly appreciated.

 

Thanks,

 

Ashton

23 answers
  1. Oct 25, 2017, 5:03 PM

    My bad.

     

    I had the order of the arguments to MAKEDATE swapped around.  I loaded it up as

     

    MAKEDATE( yy, dd, mm)

     

    But it should be

     

    MAKEDATE(yy, mm, dd)

     

    I have fixed it in the attached.

0/9000