Forum Discussion
sw123
4 years agoHelper III
Problems with week number
Hi, I have a date table with a week year column like this: "Week year", YEAR([Date]) & " "& WEEKNUM([Date], 21) In our calender (ISO 8601) Januari 1st and 2nd 2022 is part of week 52 202...
- 4 years ago
Hi sw123 ,
Try this:-
Column = VAR week_num = 1+ INT ( DIVIDE ( ( [Date] - WEEKDAY ( [Date], 16 ) + 1 ) - ( DATE ( YEAR ( [Date] ), 1, 1 ) ), 7 ) ) RETURN "Week year " & YEAR ( [Date] ) & " " & week_numThanks,
Samarth
Samarth_18
4 years agoCommunity Champion
Hi sw123 ,
Try this:-
Column =
VAR week_num =
1+ INT (
DIVIDE (
(
[Date] - WEEKDAY ( [Date], 16 ) + 1
)
- ( DATE ( YEAR ( [Date] ), 1, 1 ) ),
7
)
)
RETURN
"Week year " & YEAR ( [Date] ) & " " & week_num
Thanks,
Samarth