Skip to main content

Hello,

 

I have an Excel sheet where the date format is YY - MMM. When uploading to Tableau, it reads it in a different format MM - DD - YYYY.

In the picture I uploaded you can see that I have data for the year of 2022, but because of Tableau formatting, in the attached workbook the dates are only for 2021.

Would love to hear if anyone have a solution :-)

(I tried right click on the field and change the format, with no luck)

 

Thanks you!

Yaron

6 réponses
  1. 23 oct. 2021, 00:12

    Excel is automatically interpreting these as dates, not strings. If you select one of the cells, you'll see it's interpretation.

     

    Excel is automatically interpreting these as dates, not strings. If you select one of the cells, you'll see it's interpretation. As you can see, Excel is interpeting this as a format of DD-MMM. 

    As you can see, Excel is interpeting this as a format of DD-MMM. Excel then saves this value as the raw date and simply formats it as DD-MMM. The actual value stored in the cell above is 1/22/2021 (M/DD/YYYY format). Tableau then reads what's stored in Excel, so it's reading 1/22/2021.

     

    If you want to be able to deal with this in YY-MMM format, then there are a few different approaches, all of which will require edits to Excel. One option would be to edit each date so that they have a month, day, and year (just use 1 for the day), then format as YY-MMM. Tableau will read this properly. Another option is to format your field as text, in Excel, before entering the values. By formatting it as a string, Excel will not try to convert to a date, so Tableau will read it properly. You'll see something like this:

     

    image 

    You can then parse this to create a true date.

     

    Date

    // Parse the Month field

    DATE(DATEPARSE('YY-MMM', [Month]))

     

    image 

0/9000