ISO WeekNumber Calculation which gives the WeekNumbers from Week 1 to till present Week.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi all,
I need the calculation which will calculate the ISO WeekNumbers from Week1 to till the current week.
If anyone has this logic, kindly share it.
Thanks in advance.
Br,
Sreenivasa Teja.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Take a look at this one: https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Convert-date-to-week-number-of-that-ye...
PadLeft(ToString(FLOOR(DateTimeDiff(DateTimeAdd([Field1],4-Switch(DateTimeFormat([Field1],"%a"),7,"Mon",1,"Tue",2,"Wed",3,"Thu",4,"Fri",5,"Sat",6),"days"),DateTimeParse(ToString(ToNumber(DateTimeFormat(DateTimeAdd([Field1],4-Switch(DateTimeFormat([Field1],"%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")
which lines up with ISO which is perhaps the most accepted standard.
Give this a try and let me know if it helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @BrandonB
Thank you for your quick response.
I know this ISO WeekNumber formula. But, this gives the current weeknumber where as I need the formula which gives the results of ISO WeekNumber from Week 1 to till the current week which is Week 15 continuously.
If you can provide this logic that would be really great!
Awaiting your response.
Best Regards,
Sreenivasa Teja.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @stj1120, it has been a few days since you posted this question, so not sure if you are still looking for a solution. I found some elegant solutions posted on these community pages which will give you ISO week numbers for a given date. I have attached an implementation of these formulas it is helps.
Or this article
Hope this helps, and thanks for posting this question!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@BrandonB I've been trying to figure this out for a long time. This formula is what I need. Thank you!
Showing you my tedious logic to get FSCL and CAL Week in the attached file. Is it possible to convert my work to a formula as well? The rule is FSCL_WEEK resets per year on Monday and CAL_WEEK resets per year on Sunday.
