Attached is my data table. You can see that my dates in the x-axis in my chart is not in order. How do I write a script to sort the date column before I build the chart? Notice that my date column in the table is in char.
JMP will create the JSL version of how to do the conversion, after you go through it interactively.
Here is the JSL taken from the log, after I converted the column interactively
// Change column info: vDate
Data Table( "table1" ):vDate << Data Type(
Numeric,
Format( "m/d/y", 10 ),
Input Format( "m/d/y" )
) << Delete Formula << Set Modeling Type( "Continuous" ) << Set Field Width( 12 );You
This is a common problem when you are new to JMP. Dates should be stored as a number. Numbers are right-justified in the data table. Your date column is stored as a character string, which you can tell because it is left-justified. JMP orders character strings alphabetically. I added a column to convert your date to numeric. Open up the column info on the new Date field so you can see how this conversion is made. It could have been done on the original date column, but I thought it would be harder for you to see.
Hello Dan,
I know how to do it in JMP. But how do you write a script in JSL to convert the vDate column from char to numeric date?
The vDate column needs to be converted to a JMP Date value.
Your column should now be in a JMP date format. You can now use Tables=>Sort to sort the data table.
Hello Jim,
I know how to do it in JMP. But how do you write a script in JSL to convert the vDate column from char to numeric date?
JMP will create the JSL version of how to do the conversion, after you go through it interactively.
Here is the JSL taken from the log, after I converted the column interactively
// Change column info: vDate
Data Table( "table1" ):vDate << Data Type(
Numeric,
Format( "m/d/y", 10 ),
Input Format( "m/d/y" )
) << Delete Formula << Set Modeling Type( "Continuous" ) << Set Field Width( 12 );You
Hi Jim,
A big thank you, it worked for me!