キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
言語を選択 翻訳バーを非表示
lisamaley
Level IV

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

 

 

2 件の受理された解決策

受理された解決策
txnelson
Super User

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.

Jim

元の投稿で解決策を見る

Craige_Hales
Super User

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!

Craige

元の投稿で解決策を見る

4件の返信4
txnelson
Super User

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.

Jim
Craige_Hales
Super User

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!

Craige
lisamaley
Level IV

Re: Date Week of the year

I changed it to a number first and it worked!

lisamaley
Level IV

Re: Date Week of the year

Thank you!  this worked!

おすすめの記事