I have an Excel table that I am manually updating on a weekly basis. Next, I open this table in JMP and Stack every column from column 2 onward. With every weekly update, I add more columns to the initial table. I recently took an Intro to JMP Scripting class and I'm looking to automate this process a bit instead of re-Stacking it from scratch every time.
Here is what the table looks like in JMP before performing the Stack:
I know how to import the Excel table into JMP via a script like so:
Open(
"Drive:\Folder\File.xlsx",
Worksheets( "Data" ), // etc.
But where I had a question is how do I change the JMP script to ask it to Stack columns 2 through end?
I have the following from doing a manual Stack in JMP and looking at the source script:
Data Table( "Data" ) << Stack(
columns(
:Name( "8/23/2021" ),
:Name( "08/30/2021" ),
:Name( "09/06/2021" ),
:Name( "09/13/2021" ),
:Name( "09/20/2021" ) // etc.
),
Source Label Column( "Failure Group Name" ),
Stacked Data Column( "% Share, Week of" )
);
and I have the framework of a For( function I can use:
For( c = 2, i <= N Col(), c++,
//body//
but I just don't quite know how to put them together. Is it putting the Stack( command inside the For( command somehow?
Thanks to anyone who can help!