Hello Alteryx Community,
I'm currently working on a project where I need to calculate the ISO week number for a given date in Alteryx. The ISO week number system starts with Monday as the first day of the week. Below is an example of dates with Numweek. For 6/26/2025, numweek is 26. I tried looking for a formula but was not able to find one.
I'm looking for guidance on how to accurately compute the ISO week number in Alteryx. Any insights, formulas, or best practices would be greatly appreciated!
Thank you in advance for your help!
Kamen
Solved! Go to Solution.
Hi @KamenRider
Not sure if the simple datetimeformat to Weeknum and add 1 to it will work for all dates, i suspect not, but that works for your examples.
Another way is using this formula
PadLeft(ToString(FLOOR(DateTimeDiff(DateTimeAdd([DateTime_Out],4-Switch(DateTimeFormat([DateTime_Out],"%a"),7,"Mon",1,"Tue",2,"Wed",3,"Thu",4,"Fri",5,"Sat",6),"days"),DateTimeParse(ToString(ToNumber(DateTimeFormat(DateTimeAdd([DateTime_Out],4-Switch(DateTimeFormat([DateTime_Out],"%a"),7,"Mon",1,"Tue",2,"Wed",3,"Thu",4,"Fri",5,"Sat",6),"days"),"%Y")))+'-01-01',"%Y-%m-%d"),"days")/7)+1),2,"0")
Workflow with both examples attached
Thank you so much! Both will work.
Hello Alteryx Community,
I'm working on a project where I need to calculate the ISO week number for a given date in Alteryx.
The key points:
ISO weeks start on Monday
The first week of the year is the one that contains the first Thursday
For example, for 6/26/2025, the ISO week number is 26.
I've searched for a formula in Alteryx but haven’t been able to find an accurate method yet. Does anyone have:
A working formula?
A workaround using DateTime functions?
A custom macro to share?
Any guidance or best practices would be very appreciated!
Thanks in advance,
Hi @WirkKarl
Below 2 formulas provided by @davidskaife are kind of working. You can try it if it resolve your problem.
Kamen