Hi,
I have the following input data table, attached input_table.jmp, which is treated by my script, see below or attached after_import_analysis_script.jsl. I want to convert col 1 (character, nominal, input format "<DL><DD>/<MM>/<YY> <HH>:<MM>:<SS>") to Date (numeric, continuous, output format <CODE class=" language-jsl">"
.<MM>.<YY> <HH>:<MM>:<SS>"</SS></MM></HH></YY></MM>). However if I use my script then the conversion is wrong in the rows from 2656 to 2657,
. It converts it instead to "<MM>.</MM>. ::" from row 2657 on. Therefore the duration between row 2656 to 2657 is a month instead of 10 seconds. Please find the buggy data table attached as bugged.jmp
Any idea what's wrong here?
I am using Windows 10, JMP 18 as well as JMP 18 Pro.
Thanks!
script:
dt = Current Data Table();
// Column configuration
dt << Begin Data Update;
// Rename and configure columns using column numbers
Column(dt, 1) << Set Name("Date")
<< Data Type(Numeric)
<< Modeling Type("Continuous")
<< Format("Format Pattern", "<DL><DD>.<MM>.<YY> <HH>:<MM>:<SS>", 17, 0 )
<< Input Format( "Format Pattern", "</SS></MM></HH></YY></MM></DD><DD>/<MM>/<YY> <HH>:<MM>:<SS>", 0 );
Column(dt, 2) << Set Name("minutes")
<< Formula((:Date-:Date[1]) / 60)
<< Format("Best", 12);
Column(dt, 3) << Set Name("Temperature 1 [°C]");
Column(dt, 4) << Set Name("Temperature 2 [°C]");
Column(dt, 7) << Set Name("Target Temperature 1 [°C]");
Column(dt, 8)</img> << Set Name("Target Temperature 2 [°C]");
// Remove unused columns
dt << Delete Columns({"Col 5", "Col 6"});
dt << End Data Update;
// Set display properties
dt << Set Display Width("Date", 180);
dt << Set Display Width("minutes", 50);
dt << Set Display Width("Temperature 1 [°C]", 50);
dt << Set Display Width("Temperature 2 [°C]", 50);
Graph Builder(
Size( 1239, 816 ),
Variables( X( :minutes ), Y( :"Temperature 1 [°C]"n ) ),
Elements(
Points( X, Y, Legend( 7 ) ),
Smoother(
X,
Y,
Legend( 9 ),
Method( "Local Kernel" ),
Lambda( 0.000001 ),
Local Width( 0.1284 )
)
)
);
<P> </P>
<P> </P></SS><LINGO-LABS id="lingo-labs-871651" slang="en-US" mode="CREATE"><LINGO-LABEL>Automation and Scripting</LINGO-LABEL><LINGO-LABEL>Windows</LINGO-LABEL></LINGO-LABS></MM></HH></YY></MM></DD></DL>I think the issue might happen because you are chaining the formatting messages. Change to Numeric will happen before Input format which will happen before format -> JMP will decide the format to use when column is changed to Numeric. You could either re-order them OR send them at the same time, especially the ones related to the data type.
Instead of
Column(dt, 1) << Set Name("Date")
<< Data Type(Numeric)
<< Modeling Type("Continuous")
<< Input Format( "Format Pattern", "<DL><DD>/<MM>/<YY> <HH>:<MM>:<SS>", 0 )
<< Format("Format Pattern", "</SS></MM></HH></YY></MM></DD><DD>.<MM>.<YY> <HH>:<MM>:<SS>", 17, 0 );
<P>use something like</P>
<PRE><CODE class=" language-jsl">Column(dt, 1) << Set Data Type(
Numeric,
Input Format("Format Pattern", "/<MM>/<YY> <HH>:<MM>:<SS>", 0),
Format("Format Pattern", "</SS></MM></HH></YY></MM>.. ::", 17, 0)
) << Set Modeling Type("Continuous") << Set Name("Date");Thanks for rapid reply!
I understand the issue and your suggested solutions work.
Thanks!