4 Replies Latest reply on Feb 14, 2012 3:14 PM by Tracy Rodgers

    Week format

    Xavier P

      Hi peeps, this one is odd!  I have a nicely formatted column of 2012 W1, 2012 W2 and 2012 W3.

       

      Yet, Tableau does not recognize it as a date.  Any idea why?

        • 1. Re: Week format
          Alex Kerin

          That's not a standard date format I believe. You need to convert it to one

           

          The calculation turns out to be fairly convoluted - you may be able to simplify it:

           

          dateadd('week',(float(right([week],len([week])-6))-1),date("1/1/"+left([week],4)))

          • 2. Re: Week format
            Xavier P

            thanks Alex, it was in the date format in my tableau so it's odd that 2012 W2 is not working.  See workbook attached, I will try to avoid calculations if i can.

            • 3. Re: Week format
              Alex Kerin

              Don't know - obviously the normal, plus numeric.

              • 4. Re: Week format
                Tracy Rodgers

                Hi Mister X,

                 

                Though the Data Type was assigned a date field in Tableau, it is not in a date format that Tableau is able to read as a date. In order for Tableau to recognize it as a date, it needs to be structured as a month day year in the data source (i.e. 2/14/2012 or February 14, 2012). Once the date is in a format in the data source that is recognized by Tableau, then the format can be changed in Tableau to look like 2012 W2.

                 

                By using the calculation that Alex provided, it converts the Date field to a date that can be recognized as such by Tableau.

                 

                Hope this makes sense!

                 

                -Tracy