Hello,
I have been creating an application that involves the user to select columns to use in building a model, for select PQAs, through the use of modal windows, as in the attached JMP file with the toy data and script titled "Model for Select PQAs and Columns".
This model is supposed to create custom output for each PQA selected for any dataset with any spelling of column names. Which the script is run, a pop-up comes up asking the user to select specific columns. This window is shown in the figure below:

The next window asks the user to set the PQAs, storage condition, and asks if the user wants to view the subset dataset for each PQA - storage condition or not. That is, for each PQA selected, a subset dataset is created in the background. Then, model and graph results are produced and then appended at each iteration of the for loop to a window with the customized and formatted data (with the LSL and USL y-axis lines and y-axis labels with measurements).

Here is the JSL script code that produces the output given the user input from the windows mentioned above:
//select the data in the original data table
Names Default To Here( 1 );
dt = Current Data Table();
//get the unique PQAs
col9 = Column(dt, "PQA");
unique_pqa = Associative Array( col9 ) << get keys;
/////////////////////////////////////////////////////////////
//User Selection Menu(s)
/////////////////////////////////////////////////////////////
//Part 1: ask user for column names in a new window nw1
//possible Group column name (should be character)
character_col_names = dt << Get Column names(character, String);
//possible result column name (should be numeric)
numeric_col_names = dt << Get Column names(Numeric, String);
nw1 = New Window("Column names",
<<MODAL></MODAL>
With my output window created, I want to be able to save the script to the original data table with all data in it (that the subset data is dependent on). However, when I save the scripts for all output to script window, I get the following results:
Notice the
Where ( :PQA == pqa_val & column(listDT, set_storage_condition_col) == selected_stor_cond )
statement does not allow the script to work.
I want this statement in this script to have the particular output. For example, in the toy dataset I have attached, the
column(listDT, set_storage_condition_col)
is equal to :Storage Condition
Additionally, if I were to select A as the pqa_val ( so that :PQA == "A" ) and 5C as the selected_stor_cond (so that :Storage Condition == "5C").
However, the output script produced would not be existent, even though I am referring to the user input. Why isn't JMP writing these values as in this example above into the script for each particular instance in the loop?
Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute should help you. Also << Close Window is unnecessary in button presses as you are using modal windows.
I added one Eval(EvalExpr()) and few Expr() around and inside the where statement.:
View more...
//select the data in the original data table
Names Default To Here(1);
dt = Current Data Table();
//get the unique PQAs
col9 = Column(dt, "PQA");
unique_pqa = Associative Array(col9) << get keys;
/////////////////////////////////////////////////////////////
//User Selection Menu(s)
/////////////////////////////////////////////////////////////
//Part 1: ask user for column names in a new window nw1
//possible Group column name (should be character)
character_col_names = dt << Get Column names(character, String);
//possible result column name (should be numeric)
numeric_col_names = dt << Get Column names(Numeric, String);
nw1 = New Window("Column names",
<<MODAL></MODAL>
Thanks you so much. I didn't even think about using Eval() and related. I will definitely read more about this and will take a look at that link you provided.