- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Date Week of the year
I have a date code that gives me the year, day of the week (Saturday for instance) and the week of the year (week 50 for instance). Is there a way to change this information into a date?
I have a MacBook Monterey 12.6 with JMP Pro version 17.0
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Date Week of the year
This equation will calculate the date given the 3 variables you specified
In Years( :year - 1904 ) + In Weeks( :week of the year ) + In Days( :day of the week )
This equation assumes the week of the year begins on January 1. If your data has a rule for what day the week of the year begins, like the first Sunday of the year that offset will have to be calculated and then added to the formula.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Date Week of the year
Also, make allowances for day-of-week and week-of-year starts with 0 or 1.
Jim is right, there are a lot of ways you might define week of the year. Many of the worst bugs I've worked on had something to do with time calculations. Test your code carefully!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Date Week of the year
This equation will calculate the date given the 3 variables you specified
In Years( :year - 1904 ) + In Weeks( :week of the year ) + In Days( :day of the week )
This equation assumes the week of the year begins on January 1. If your data has a rule for what day the week of the year begins, like the first Sunday of the year that offset will have to be calculated and then added to the formula.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Date Week of the year
Also, make allowances for day-of-week and week-of-year starts with 0 or 1.
Jim is right, there are a lot of ways you might define week of the year. Many of the worst bugs I've worked on had something to do with time calculations. Test your code carefully!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Date Week of the year
I changed it to a number first and it worked!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Date Week of the year
Thank you! this worked!