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
Georg
Level VII

Is there a way to uses Week of the year in Format Patterns?

Dear Community,

I want to make a string containing the week of a date,

is it possible to do so with Format Patterns?

Of course I could compose as a string, but I like the tight way doing it with Format Patterns.

 

Thanks and best regards,

 

 

Names Default To Here( 1 );
Print( Format( Today(), "Format Pattern", "<YYYY>_<MM>" ) );
// Format Patern does not recognize WW
Print( Format( Today(), "Format Pattern", "<YYYY>_<WW>" ) );

// this works
Print( Char( Year( Today() ) ) || "_" || Right( "0" || Char( Week Of Year( Today() ) ), 2 ) );
Georg
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Is there a way to uses Week of the year in Format Patterns?

txnelson_0-1722943988604.png

Names Default To Here( 1 );
Print( Format( Today(), "Format Pattern", "<YYYY>_<MM>" ) );
// Format Patern does not recognize WW
Print( Format( Today(), "Format Pattern", "<YYYY>_<WW1>" ) );

"2024_08"
"2024_32"

Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Is there a way to uses Week of the year in Format Patterns?

txnelson_0-1722943988604.png

Names Default To Here( 1 );
Print( Format( Today(), "Format Pattern", "<YYYY>_<MM>" ) );
// Format Patern does not recognize WW
Print( Format( Today(), "Format Pattern", "<YYYY>_<WW1>" ) );

"2024_08"
"2024_32"

Jim
Georg
Level VII

Re: Is there a way to uses Week of the year in Format Patterns?

great - Thanks!

Georg
hogi
Level XII

Re: Is there a way to uses Week of the year in Format Patterns?

Iso week (ww) is also very helpful. Keep in mind that it can just be used in combination with ISO year (yyyy).
Unfortunately, there is an issue in Graph Builder with this time format - year 2023 is missing:
https://community.jmp.com/t5/Discussions/Time-binning-how-to-change-the-Tick-labels/m-p/762929/highl... 

 

hogi_0-1722957136975.png