cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
joshua
Level III

Getting work week (WW) from "m/d/y h:m:s AM|PM" format

Hi,

I have a trouble to getting the work week from rows. Let's say I have a date and time format like this 

joshua_0-1582050202000.png

I tried following things by following the JSL manual @ page 150 and so forth but could not resolve this,
first I thought that I need to get rid of time values 

dt << New Column( "Date_new",
Numeric, Continuous,
Formula(Format(:Name("Date"), "m/d/y")),
);

Then now I have the dates like this 

joshua_1-1582050456837.png

Next I tried to get ww of Date_new

dt << newcolumn("ww",Numeric, "Nominal",Week Of Year (Date MDY(:Date),3));

But got nothing! Why?

joshua_2-1582050619470.png

 

 

 

 

 

 


 

6 REPLIES 6
joshua
Level III

Re: Getting work week (WW) from "m/d/y h:m:s AM|PM" format

No answers yet ?
txnelson
Super User

Re: Getting work week (WW) from "m/d/y h:m:s AM|PM" format

dt << New Column( "Date_new",
Numeric, Continuous,
Formula(WeekOfYear(:date)),
);

All you need to do is to pull out the work week from the original :Date column.  Your formula for the "New Date" column was using a Format() function, which returns a character string.  But that issue can all be circumvented  with the above column definition.

Jim
joshua
Level III

Re: Getting work week (WW) from "m/d/y h:m:s AM|PM" format

This is great and funny! nowwhere in the manual mention about `Formula(Weekofyear)` syntax.
stan_koprowski
Community Manager Community Manager

Re: Getting work week (WW) from "m/d/y h:m:s AM|PM" format

Hi @joshua,

Here is a link to the page in the documentation with the weekofyear function.

cheers,

Stan

Re: Getting work week (WW) from "m/d/y h:m:s AM|PM" format

Just Open a new column in JMP and in the formula section find WEEK OF YEAR.

 

Week Of Year(date).

 

that's it....hope it helps.

hogi
Level XIII

Re: Getting work week (WW) from "m/d/y h:m:s AM|PM" format

Recommended Articles