We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How to Compute ISO Week Numbers Correctly in Alteryx?

KamenRider
11 - Bolide

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.

 

Numweek.JPG

 

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 

4 REPLIES 4
davidskaife
14 - Magnetar

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.

 

Screenshot 2025-07-04 140131.png

 

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

 

KamenRider
11 - Bolide

Thank you so much! Both will work.

WirkKarl
7 - Meteor

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,

KamenRider
11 - Bolide

Hi @WirkKarl 

 

Below 2 formulas provided by @davidskaife are kind of working. You can try it if it resolve your problem.

 

Kamen

Labels
Top Solution Authors