cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
JSL to Create a New Data Table

Problem

You are writing JSL to make a data table and you are not sure how to script creating the table and columns.

Solution

Make a data table, using JMP's GUI, that looks the way you want. Add the numeric formats (dates, etc) to the columns that need them, and formula columns too. Then delete the rows, or leave the rows with the default data you need. Finally, use the red triangle and pick "Copy Table Script". Go back to the script editor, type "dt =" and paste the script.


// typical JSL for an empty table with one column

New Table( "Untitled",
	Add Rows( 0 ),
	New Column( "Column 1", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [] ) )
)

Discussion

Use dt = New Table(...) to get a variable that you can use to reference the table. Look in the scripting index to see the commands you can send to the table using dt.


See Also

Help for Data Tables

JSL Cookbook

If you’re looking for a code snippet or design pattern that performs a common task for your JSL project, the JSL Cookbook is for you.

This knowledge base contains building blocks of JSL code that you can use to reduce the amount of coding you have to do yourself.

It's also a great place to learn from the experts how to use JSL in new ways, with best practices.