cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
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 XII

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