Are you not just trying to get the current week which can be obtained using Datepart('week',[Your Date])
With this, you can modify as required to suit your calcs.
So this has got a bit messy for me as Tableau is refusing to accept Monday as the start of the week.
According to Wiki, the calc is Int((([Ordinal Position] - [day of week]) + 10) / 7)
Ordinal position is the day's position in the year so 10th Feb 10/02/2016 = 41
Day of week for 10th Feb assuming the first day of the week is Monday = 3
((41 - 3) + 10) / 7 = 6.857 for which the Int is 6 so the Week for 10th Feb is week 6
Now onto the calcs:
[Ordinal Date] Attr(datepart('dayofyear',[Order Date]))
[Week Day] (nb I had to correct this as Tableau is ignoring the start of the week for me)
If Attr(datepart('weekday',[Order Date])-1) = 0 Then 7
Else Attr(datepart('weekday',[Order Date])-1)
1 of 1 people found this helpful
I think I've done.
My company also uses workweeks and this is under my coverage
But please double check. The logic itself can be used, so you can modify if needed.
(datetrunc('week',[Fecha],"Monday")+3 // 12/28 = ww53, 12/29 = ww01
makedate(year(datetrunc('week',[Fecha],"Monday")+3),1,1) // same year January 1st
Thanks SHINICHIRO MURAKAMI! It´s perfect for us. best regards, Carlos