KNOWLEDGE BASE

How to Display Start Day And End Day Of Week Instead Of Week Number


Published: 21 May 2020
Last Modified Date: 22 May 2020

Question

How to show the range of week by the start day and the end day of the week, such as 12/30 - 1/5, instead of the week number for a date field? 

Environment

  • Tableau Desktop

Answer

Create a calculated field named as Start Day - End Day of Week which contains the following calculation.
STR(MONTH(DATETRUNC('week',[Order Date])))+"/"+
STR(DAY(DATETRUNC('week',[Order Date])))
+ " - " +
STR(MONTH(DATETRUNC('week',DATEADD('week',1,[Order Date]))-1))+"/"+
STR(DAY(DATETRUNC('week',DATEADD('week',1,[Order Date]))-1))
The above calculation is demonstrated in the attached workbook.
Did this article resolve the issue?