How to save a datatable as a script. It's easy but when I Google it the top results aren't the answer. So I'm going to answer my own question.
This is also useful for learning JSL. You can create and format columns, also formulas, and see the JSL for it.
1. Create datatable.
2. Red hot spot for scripts - > Copy Table Script
3. Red hot spot for scripts -> New Script
4. Give the script a title, paste the script, save.
New Table( "Slider Test",
Add Rows( 26 ),
Set Header Height( 47 ),
New Column( "SKU",
Character,
"Nominal",
Set Selected,
Set Values(
{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N",
"O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
)
),
New Column( "Sales",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[98, 64, 120, 397, 93, 58, 196, 700, 674, 229, 607, 55, 590, 169, 1449,
1236, 143, 1714, 364, 404, 226, 1300, 1105, 144, 1391, 1893]
),
Set Display Width( 94 )
),
New Column( "ABC Class",
Character,
"Nominal",
Set Values(
{"C", "C", "B", "B", "C", "C", "B", "B", "B", "B", "B", "C", "B", "B",
"A", "A", "B", "A", "B", "B", "B", "A", "A", "B", "A", "A"}
),
Set Display Width( 70 )
)
)
This is also useful for learning JSL. You can create and format columns, also formulas, and see the JSL for it.
1. Create datatable.
2. Red hot spot for scripts - > Copy Table Script
3. Red hot spot for scripts -> New Script
4. Give the script a title, paste the script, save.
New Table( "Slider Test",
Add Rows( 26 ),
Set Header Height( 47 ),
New Column( "SKU",
Character,
"Nominal",
Set Selected,
Set Values(
{"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N",
"O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}
)
),
New Column( "Sales",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values(
[98, 64, 120, 397, 93, 58, 196, 700, 674, 229, 607, 55, 590, 169, 1449,
1236, 143, 1714, 364, 404, 226, 1300, 1105, 144, 1391, 1893]
),
Set Display Width( 94 )
),
New Column( "ABC Class",
Character,
"Nominal",
Set Values(
{"C", "C", "B", "B", "C", "C", "B", "B", "B", "B", "B", "C", "B", "B",
"A", "A", "B", "A", "B", "B", "B", "A", "A", "B", "A", "A"}
),
Set Display Width( 70 )
)
)
May Google find your answer worthy!
also: https://community.jmp.com/t5/JSL-Cookbook/JSL-to-Create-a-New-Data-Table/ta-p/42456