If the user wants to bin by week - to get Plots for Year & week, there is another issue (#2):
by default, JMP creates the binned date with the format DD / MM / YYYY.
So, instead of week, still dates (with day and month) is used up as axis labels.
So, how to tell JMP that the week should be used.
Plan A:
- adjust the Format of the current axis - to use Week instead of day and month. and indeed, it works - but the user has to do the job for every single plot he wants to adjust.
Better:
The user can directy change the Format of the column (see code below) - then the week also gets into the axis labels:
even cooler: If the user enables nesting on the axis, JMP automatically shows the week AND the year - nested.
but wait - label nesting seems to have an issue with ISO Dates , Argh !!!
Why does the center plot show 2022 instead of 2023?!??!
Converting Week and Week2 to Format "Best" shows: both columns have the same entries. So, it's not an issue of the column, right?
New Table( "test",
Add Rows( 2 ),
Compress File When Saved( 1 ),
New Column( "date",
Format( "d/m/y", 10 ),
Set Values( [3768422400, 3797366400] )
),
New Column( "Week[date]",
Format( "Format Pattern", "<yyyy> cw<ww>", 15 ),
Formula( Date Increment( :date, "Week", 0 ) )
),
New Column( "Week[date]_2",
Format( "Format Pattern", "<DD>.<MM>.<YYYY>", 15 ),
Formula( Date Increment( :date, "Week", 0 ) )
)
);
Graph Builder(
Variables( X( :date ), X( :"Week[date]"n ),X( :"Week[date]_2"n ) ),
Elements( Position( 1, 1 ), Points( X ) ),
Elements( Position( 2, 1 ), Points( X ) ),
Elements( Position( 3, 1 ), Points( X ) ),
SendToReport(
Dispatch( {}, "date", ScaleBox, {Label Row Nesting( 2 )} ),
Dispatch( {}, "Week[date]", ScaleBox, {Label Row Nesting( 2 )} ),
Dispatch( {}, "Week[date]_2", ScaleBox, {Label Row Nesting( 2 )} )
)
);
-> some improvements + bugfixes for nested binned time/date axes