BookmarkSubscribe
Choose Language Hide Translation Bar
LukeFarrell
Occasional Contributor

Re: JMP14 Script Compatibility with Older Versions

Coming off of this, it seems that the addition of more columns is where my issue arrises, as my original method works using the below script in JMP13.

 

Open(dt,
columns(
		New Column( "DateTime",
			Numeric,
			"Nominal",
			Format( "y/m/d h:m"),
			Input Format( "y/m/d h:m:s", 3 )
		);
		
		
		
	);
	
);
~ Luke :)
0 Kudos
Jeff_Perkinson
Community Manager Community Manager

Re: JMP14 Script Compatibility with Older Versions

Here's another test to run in JMP 14 and JMP 13. It works in both for me:

 

Open(
	"$SAMPLE_DATA/../Import Data/BigClass.txt",
	columns(
		New Column( "Name", Character, "Nominal" ),
		New Column( "Date",
			Numeric,
			"Nominal",
			Format( "m/d/y", 10 ),
		),
		New Column( "Sex", Character, "Nominal" ),
		New Column( "height", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "weight", Numeric, "Continuous", Format( "Best", 12 ) )
	),
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Tab, CSV( 0 ) ),
		Strip Quotes( 1 ),
		Use Apostrophe as Quotation Mark( 0 ),
		Use Regional Settings( 0 ),
		Scan Whole File( 1 ),
		Treat empty columns as numeric( 0 ),
		CompressNumericColumns( 0 ),
		CompressCharacterColumns( 0 ),
		CompressAllowListCheck( 0 ),
		Labels( 0 ),
		Column Names Start( 1 ),
		Data Starts( 1 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);

NB: The column will be filled with missing values since it's not a date value. That's okay since it's not what we're testing. We just need the column to be a Nominal modeling type.

-Jeff
0 Kudos
Jeff_Perkinson
Community Manager Community Manager

Re: JMP14 Script Compatibility with Older Versions

Another thought, at this point this is just an intellectual excercise to figure out why the two are behaving differently. If you want to ensure that the DateTime column is nominal you can do it after the Open() and that should work.

 

newdt = Open(
	"$SAMPLE_DATA/../Import Data/BigClass.txt",
	columns(
		New Column( "Name", Character, "Nominal" ),
		New Column( "Date",
			Numeric,
			"Continuous",
			Format( "m/d/y", 10 ),
		),
		New Column( "Sex", Character, "Nominal" ),
		New Column( "height", Numeric, "Continuous", Format( "Best", 12 ) ),
		New Column( "weight", Numeric, "Continuous", Format( "Best", 12 ) )
	),
	Import Settings(
		End Of Line( CRLF, CR, LF ),
		End Of Field( Tab, CSV( 0 ) ),
		Strip Quotes( 1 ),
		Use Apostrophe as Quotation Mark( 0 ),
		Use Regional Settings( 0 ),
		Scan Whole File( 1 ),
		Treat empty columns as numeric( 0 ),
		CompressNumericColumns( 0 ),
		CompressCharacterColumns( 0 ),
		CompressAllowListCheck( 0 ),
		Labels( 0 ),
		Column Names Start( 1 ),
		Data Starts( 1 ),
		Lines To Read( "All" ),
		Year Rule( "20xx" )
	)
);

//set modeling type after import newdt:Date << set modeling type( "Nominal" );
-Jeff
LukeFarrell
Occasional Contributor

Re: JMP14 Script Compatibility with Older Versions

Hi @Jeff_Perkinson, I tried the two methods you sent most recently. 

 

The first method only seemed to work for JMP14 for me and not 13, however the second method(the one this message is a direct reply to) worked on both versions!

 

 

~ Luke :)