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
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.
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!
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.
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!
I changed it to a number first and it worked!
Thank you! this worked!