There are a couple of issues.
- Different platforms have different Tree Structures because they have different output structures. Therefore the mapping to the different objects within the output is different.
- You specify dt as the pointer to the "Data table", but later in the script, you attempt to execute the Overlay Plot, pointing to a data table referenced by a variable dt2, that does not exist in your code.
- In you code that creates the Associative Array, you use a variable from your Reference Data Table, called Reference. In the sample data you provided in the Optimize Loop Discussion, the variable in that data table is called Mean.
Below is a modification of your code that produces the following output
txnelson_0-1656463531476.png
Names Default To Here(1);
// dt = Open("Data table.jmp"); // Open data table
dt=data table("Data Table");
// dt1 = Open("Reference table.jmp");
dt1=data table("Reference data table");
// Loop to get column name Currents and Voltages
colist = {};
Col_List = dt << Get Column Names("String");
For(q = 1, q <= N Items(Col_List), q++,
If(Contains(Col_List[q], "Current") | Contains(Col_List[q], "Voltage"),
Column(Col_List[q]) << Set Selected(1);
Insert Into(colist, Col_List[q]);
)
);
// Overlay Plot
vc = dt << Overlay Plot( Y( Eval( colist ) ), No Overlay( 1 ),Ungroup Plots( 1 ) );
aa_refs = Associative Array(dt1:Tests << get values, dt1:mean << get values);
// Loop to add reference line to the variability chart
For(i = 14, i <= N Items(colist), i++,
If(Contains(aa_refs, colist[i]),
Report(vc)[AxisBox(1)] << Add Ref Line(aa_refs[colist[i]], "Solid", "Green", "RTS", 2);
);
);
Please take the time to read up on Display Trees in the Scripting Guide, available in the JMP Documentation Library, under the Help pull down menu.
Jim