BASE DE CONNAISSANCES

How to Display Week Number by Month


Date de publication : 01 Oct 2019
Date de dernière modification : 24 Aug 2022

Question

How to display week number by month. By default week number is displayed by year. 
 

Environnement

Tableau Desktop

Réponse

The following steps are displayed in the attached workbook called "week_sample.twbx" found in the upper right hand corner of this page. A fixed Level of Detail (LOD) expression is used.
  1. Create a [Week-min] calculation field as shown below: { FIXED MONTH([Order Date]):MIN(DATEPART('week',[Order Date]))}

  2. Create a [Week-updated] calculation field as shown below CASE DATEPART('week',[Order Date]) WHEN [Week-min] THEN "Week 1" WHEN [Week-min]+1 THEN "Week 2" WHEN [Week-min]+2 THEN "Week 3" WHEN [Week-min]+3 THEN "Week 4" WHEN [Week-min]+4 THEN "Week 5" WHEN [Week-min]+5 THEN "Week 6" END
Note: The attached workbook was built in Tableau Desktop 2019.3.0.

Informations supplémentaires


Days in week per month
Cet article vous a-t-il permis de résoudre le problème ?