Forum Discussion

sw123's avatar
sw123
Helper III
4 years ago
Solved

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...
  • Samarth_18's avatar
    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_num

     

    Thanks,

    Samarth