cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
%3CLINGO-SUB%20id%3D%22lingo-sub-779525%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EEsiste%20un%20modo%20per%20utilizzare%20la%20settimana%20dell'anno%20nei%20modelli%20di%20formato%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-779525%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECara%20comunit%C3%A0%2C%3C%2FP%3E%3CP%3EVoglio%20creare%20una%20stringa%20contenente%20la%20settimana%20di%20una%20data%2C%3C%2FP%3E%3CP%3E%C3%88%20possibile%20farlo%20con%20Format%20Patterns%3F%3C%2FP%3E%3CP%3ENaturalmente%20potrei%20comporre%20come%20una%20stringa%2C%20ma%20preferisco%20farlo%20in%20modo%20pi%C3%B9%20preciso%20con%20i%20Format%20Patterns.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EGrazie%20e%20distinti%20saluti%2C%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0APrint(%20Format(%20Today()%2C%20%22Format%20Pattern%22%2C%20%22%3CYYYY%3E_%3CMM%3E%22%20)%20)%3B%0A%2F%2F%20Format%20Patern%20does%20not%20recognize%20WW%0APrint(%20Format(%20Today()%2C%20%22Format%20Pattern%22%2C%20%22%3CYYYY%3E_%3CWW%3E%22%20)%20)%3B%0A%0A%2F%2F%20this%20works%0APrint(%20Char(%20Year(%20Today()%20)%20)%20%7C%7C%20%22_%22%20%7C%7C%20Right(%20%220%22%20%7C%7C%20Char(%20Week%20Of%20Year(%20Today()%20)%20)%2C%202%20)%20)%3B%3C%2FWW%3E%3C%2FYYYY%3E%3C%2FMM%3E%3C%2FYYYY%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-779525%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EAutomazione%20e%20scripting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAnalisi%20e%20modellazione%20dei%20dati%20di%20base%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-779547%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ER%3A%20Esiste%20un%20modo%20per%20utilizzare%20la%20settimana%20dell'anno%20nei%20modelli%20di%20formato%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-779547%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22txnelson_0-1722943988604.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1722943988604.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1722943988604.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22txnelson_0-1722943988604.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F66870i592D4C92F0F7FAA2%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22txnelson_0-1722943988604.png%22%20alt%3D%22txnelson_0-1722943988604.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0APrint(%20Format(%20Today()%2C%20%22Format%20Pattern%22%2C%20%22%3CYYYY%3E_%3CMM%3E%22%20)%20)%3B%0A%2F%2F%20Format%20Patern%20does%20not%20recognize%20WW%0APrint(%20Format(%20Today()%2C%20%22Format%20Pattern%22%2C%20%22%3CYYYY%3E_%3CWW1%3E%22%20)%20)%3B%3C%2FWW1%3E%3C%2FYYYY%3E%3C%2FMM%3E%3C%2FYYYY%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%222024_08%22%3CBR%20%2F%3E%20%222024_32%22%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-779550%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ER%3A%20Esiste%20un%20modo%20per%20utilizzare%20la%20settimana%20dell'anno%20nei%20modelli%20di%20formato%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-779550%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3Egrazie%20mille!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-779618%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ER%3A%20Esiste%20un%20modo%20per%20utilizzare%20la%20settimana%20dell'anno%20nei%20modelli%20di%20formato%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-779618%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EAnche%20la%20settimana%20ISO%20(%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Eww%3C%2FFONT%3E%20)%20%C3%A8%20molto%20utile.%20Tieni%20presente%20che%20pu%C3%B2%20essere%20usata%20solo%20in%20combinazione%20con%20l'anno%20ISO%20(%20%3CFONT%20face%3D%22courier%20new%2Ccourier%22%3Eyyyy%3C%2FFONT%3E%20).%3CBR%20%2F%3E%20Sfortunatamente%2C%20c'%C3%A8%20un%20problema%20in%20Graph%20Builder%20con%20questo%20formato%20di%20ora%3A%20manca%20l'anno%202023%3A%3CBR%20%2F%3E%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FTime-binning-how-to-change-the-Tick-labels%2Fm-p%2F762929%2Fhighlight%2Ftrue%23M94343%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Fcommunity.jmp.com%2Ft5%2FDiscussions%2FTime-binning-how-to-change-the-Tick-labels%2Fmp%2F762929%2Fhighlight%2Ftrue%23M94343%3C%2FA%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22hogi_0-1722957136975.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22hogi_0-1722957136975.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F66877iB282206CA8352DCB%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22hogi_0-1722957136975.png%22%20alt%3D%22hogi_0-1722957136975.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E
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