cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
FN
FN
Level VI

How to force a new best guess a column (modeling type and data type)

I am initiating a column as character containing empty values.

 

Later on, this column will be populated with data from a data base that can be any type. By having characters no transformation is done by JMP.

 

How can I force a new best guess via JSL?

 

 

 

3 REPLIES 3
txnelson
Super User

Re: How to force a new best guess a column (modeling type and data type)

Here is how I would approach the issue.  The simple description is to subset out the column in question, save it as a .csv file and then have JMP read in the column using the Best Guess capability and then moving the column back into the original data table.

names default to here(1);
// Createa sample data table
dt=New Table( "Example",
	Add Rows( 2 ),
	New Script(
		"Source",
		Data Table( "Untitled 7" ) << Subset( All rows, columns( :test ) )
	),
	New Column( "test",
		Character,
		"Nominal",
		Set Values( {"01/28/2020", "09/14/2021"} )
	)
);

// Separate out the column in question
dttest=dt<<subset(selected rows(0), columns(test));

// Save the column to a .csv format and close the table
dttest << save("$TEMP\test.csv");
close(dttest, nosave);

// Open the saved table allowing JMP to use the Best Guess on the column
dtnew = open("$TEMP\test.csv");

// Delete the original column from the original data table
dt << delete column(test);

// Merge the new verstion of the column back into the original data table
dt << Update( With( dtNew ) );

// Close the single column transfer data table
close(dtnew, nosave );
Jim
FN
FN
Level VI

Re: How to force a new best guess a column (modeling type and data type)

JMP is somehow slow writing CSVs, and until JMP 16 also reading them.

 

I was expecting access to the method used in JMP when loading new files.

 

dt:column << Type(Best Guess) 

 

txnelson
Super User

Re: How to force a new best guess a column (modeling type and data type)

I am not aware of any such option
Jim