Hello all,
I have a JMP data table on which I want to create a script to create a subset based on a timeframe I want to keep flexible.
Looking on the community I found the following piece of script (reported here below) which is good for me, I'm only missing the part of code where, after selecting the start date and end date the subset is created in a new datatable.
Someone can help me?
Thanks.
dt = current data table ();
tmpstr =
"SELECT pen_parametric.pn_id, pen_parametric.equiplk_ky, parametric_dlk.paramlk_ky,
FROM MATS.parametric_dlk parametric_dlk, MATS.pen_parametric pen_parametric
WHERE parametric_dlk.paramlk_ky = parametric_ref_llk.paramlk_ky
AND parametric_dlk.paramlk_ky = pen_parametric.paramlk_ky
AND ((pen_parametric.part_dm Between {ts '^sdt^'} And {ts '^edt^'}))";
New Window( "Query Date",
<<Modal,
sd = Today();
ed = Today();
H List Box(
Text Box( "From:" ),
scal = Number Edit Box( sd, <<Set Format( Format( "yyyy-mm-dd" ) ), <<SetFunction( Function( {this}, sd = scal << Get ) ), <<Set Show Spin Box(1) ),
Spacer Box( Size( 20, 20 ) ),
Text Box( "To:" ),
ecal = Number Edit Box( ed, <<Set Format( Format( "yyyy-mm-dd" ) ), <<SetFunction( Function( {this}, ed = ecal << Get ) ), <<Set Show Spin Box(1) ),
);
);
sdt = Munger( Format Date( sd, "yyyy-mm-ddThh:mm:ss" ), 1, "T", " " );
edt = Munger( Format Date( ed, "yyyy-mm-ddThh:mm:ss" ), 1, "T", " " );
Show( sdt, edt );
qstring = Eval Insert( tmpstr );
Show( qstring )