KNOWLEDGE BASE

Week Number is Incorrect for European Locales


Published: 01 Aug 2014
Last Modified Date: 28 Feb 2017

Issue

When using Tableau Desktop in a European locale, the week number might not display as expected. For example, the week of January, 4th to 10th, 2016 might display as Week 2 in Tableau Desktop instead of Week 1.

Environment

Tableau Desktop

Resolution

As a workaround, use calculated fields to convert week numbering to the ISO 8601 standard. The following instructions can be reviewed in the workbook attached below.

Step 1: Create a Calculated Field

  1. Select Analysis > Create Calculated field.
  2. Name the calculated field "ISO 8601 Week".
  3. Enter the following formula: 
    ROUND((DATEADD('day', 3, DATETRUNC('week',[Date]))-
    DATEADD('day', 3, DATETRUNC('year', DATEADD('day', 3, DATETRUNC('week',[Date])))) +
    DATEPART('weekday', DATEADD('day', 2, DATETRUNC('year', DATETRUNC('week',[Date]))))
    -4) / 7 + 1,0)


Step 2:  Create a Calculated Field

  1. Select Analysis > Create Calculated field.
  2. Name the calculated field "Monday of Week".
  3. Enter the following formula: 
    DATETRUNC('week',[Date]-1)+1 
    
     

Step 3: Build the View

Drag "Monday of Week" and "ISO 8601 Week" to the Columns shelf. Ensure "ISO 8601 Week" is set as Discrete
 

Cause

Tableau Desktop uses US standards for week numbers. The ability to format dates according to the ISO 8601 standard is not functionality currently built into Tableau Desktop.
Did this article resolve the issue?