My weeknum today is expression is giving me a result of 26 but when I check Google the result is 25.
What could be the reason for the difference?
Hi @Jaros
I got the exact same issue a few weeks earlier.
I guess you are in Europe ?
We have a different week counting system for weeks in Europe, compared to USA.
There is no way to set a parameter to explicitly change that, other than adding โ-1โ to weeknum.
More details here:
For now, there is no way around, but to hard codeโฆ
You could add a virtual column like CONCATENATE(20211202202023020241,etc.) and read the week number like
WEEKNUM([DATE])+LEFT(INDEX(SPLIT([WeekNumber],YEAR([DATE])),2),1)
What I heard, ISO WEEKNUM is in the pipeline of Appsheetโฆ
I would LOVE the isoweeknum
Will this work going forward into a new year? Or do you foresee issues?
No idea.
Depending on your use case, you can either:
Thatโs not really satisfying. Hopefully, there will be sometime the possiblity to pick the counting system in the locale, or to have the locale taken into account for weeknum calculation.
Strictly speaking, this is not an issue, just a matter of displaying.
As long as your users are aware of the counting system, this is not an issue
Thanks Aurelien
Will this work going forward into a new year? Or do you foresee issues?:
As long as you hard code the coming years with 52 or 53 week in the 20211202202023020241,etc., it will work. (For as many years you put into it).
thatโs a good trick.
another trick would be to calculate if the first day of year is before or after a thursday, which is the difference between US system and EU system on week counting.
then elaborate an expression based on it. Nonetheless, if ISONUMWEEK is on the pipeline, then you solution seems great
Thanks. I would love the ISOWEEKNUM too
If interested for a workaroundโฆ this should work.
FLOOR(
(10 +
IF(
MOD(YEAR(TODAY()),4) = 0,
INDEX({0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335},MONTH(TODAY())),
INDEX({0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334},MONTH(TODAY()))
) + DAY(TODAY()) - (WEEKDAY(TODAY()) - 1)) / 7
)
Thanks!
I just discovered that ISOWEEKNUM works!
yes, whole new expression
User | Count |
---|---|
16 | |
9 | |
9 | |
7 | |
3 |