cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
WoHNY
Level III

JMP 16 Useable Year Week Column

I am trying to duplicate, in jmp, extracting the week from a date column that I pull in Excel with the following formula, =TEXT(A2,"YYYY")&"-"&TEXT(WEEKNUM(A2,2),"00"). The resulting week is in yyyy-ww format with a two digit week. When I add a new column and try concatenating Year & Week (Year( :Date ) || Week Of Year( :Date )) it doesn't allow me to concatenate the "-". If I forego the "-" it does produce year-week but not in two digit format for the single digit weeks. Also, when I use this jmp formula I cannot use the generated year week in a graph as the Data Type is Expression. Any suggestions will be appreciated. Thank you.

2 REPLIES 2
Thierry_S
Super User

Re: JMP 16 Useable Year Week Column

Hi,

I believe that you need to convert the numerical output of your date functions into strings. Try preceding each expression with CHAR (). Of note, you may also use the FORMAT () function to create strings with the right number of digits and decimals.

 

Char (Year( :Date )) || " - " || Char (Week Of Year( :Date ))
// or
Format (Year (:Date), "Fixed Dec", 4, 0) || " - " || Format (Week of Year (:Date), "Fixed Dec", 2, 0)

Best,

TS

Thierry R. Sornasse
jthi
Super User

Re: JMP 16 Useable Year Week Column

One easy way to get "baseline" formula for this is to use premade formulas JMP has (if you have a date column):

jthi_0-1660291176190.png

jthi_1-1660291201706.png

 

-Jarmo