Hi, I would like to change the below date field, which is a nominal field, to m/d/y format in jsl. Please help.
Create a new numeric column
In the Col Info dialog window, set the format to m/d/y
Set a formula for the column of
Informat( :Day of Process Date, "Format Pattern", "<Month> <D>, <YYYY>" )
Here is a script that when run creates the above example data table
New Table( "Format Pattern", Add Rows( 1 ), New Column( "Day of Process Date", Character, "Nominal", Set Values( {"November 8, 2024"} ) ), New Column( "New date", Numeric, "Nominal", Format( "m/d/y", 12 ), Input Format( "m/d/y" ), Formula( Informat( :Day of Process Date, "Format Pattern", "<Month> <D>, <YYYY>" ) ) ) )
Format Pattern was released in JMP 16 so that is why the formula does not work. Here is a formula that works in JMP 15
If( Row() == 1, monthList = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" } ); Date MDY( Contains( monthList, Word( 1, :Day of Process Date, ", " ) ), Num( Word( 2, :Day of Process Date, ", " ) ), Num( Word( 3, :Day of Process Date, ", " ) ) );
When I tried to run the sample script above, the New date column doesn't populate for me. I also tried doing adding the formula manually, and it still doesn't work.
What version of JMP are you using and on what operating system.
I ran the code on both JMPPro 18 and JMPPro 16 on a Windows 11 and it ran without an issue.
Do you have any messages in the log?
No error message. I have JMP 15 and windows 10.