3

I need to convert the week field into Date(mm/dd/yyyy).

Week 1 Week 2 Week 3 Week 4 Week 5 Week 6 Week 7 Week 8 Week 9 Week 10 Week 11 Week 12 Week 13 Week 14 Week 15 Week 16 Week 17 Week 18 Week 19 Week 20 Week 21 Week 22

Actually I have dragged the date field into Columns and I selected the week.

I need to convert this into Date (mm/dd/yyyy). How to achieve this?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
shaik ahamad
  • 63
  • 1
  • 9

3 Answers3

0

Directly in your sheet, if you right click on your date field, you'll get a menu with the following options: "Filter", "Show quick filter", etc. You'll also see an option which says "Day.... May 8, 2011". That gives you a full date.

But if you want that date to have the "mm/dd/yyyy" format, you'll need to change it from the left pane. Right clicking on your date dimension provides the following option: "Default Properties/Date Format". You have a few default formats in there, including a custom formatting where you could make it mm/dd/yyyy.

Olivier

  • 1
    Olivier - I think shaik is asking how to keep the Week format, but substitute a date (of say, the first or last of the week) instead of 'Week ##'. – Ward W Sep 21 '17 at 16:53
0

I think you want this formula: DATETRUNC('week', [day], 'Monday'), assuming your week starts on Monday. You may also need to change the format to m/d/y in the left-hand pane, per Jim Dehner: https://community.tableau.com/thread/234590

For dates 1/2 - 1/9/2017 this will return (Monday) 1/2/2017. For 1/9 - 1/16, it will return 1/9/2017, etc.

Ward W
  • 640
  • 6
  • 14
0

I believe this post could help you out: https://community.tableau.com/s/question/0D54T00000C6Y9TSAV/how-to-convert-week-number-into-a-date-format

Basically you can use this formula:

DATETRUNC('week',DATE(DATEADD('week', WEEK(TODAY())-1, DATE("01/01/"+STR(YEAR(TODAY()))))))
Federico Gentile
  • 5,650
  • 10
  • 47
  • 102