I am still working with JMP Support to figure out why the table sorting is applied to values read from the table but not those written to the table. For now here is a crude work around:
names default to here(1);
dt = Open("$Sample_Data/iris.jmp");
//Open Process Screening with drift summaries
ps = dt << Process Screening(
Y( :Sepal length, :Sepal width, :Petal length, :Petal width ),
Control Chart Type( "Indiv and MR" ),
Drift Summaries( 1 )
);
//Add a dummy column and use set values to reset the table order
ncb = (ps << XPath( "//TableBox" )) << Append( newCol = NumberColBox("Delete Me", {}));
newCol << Set Values({});
newCol << Delete Box;
//calculate the combined drift
UpDrift = (ps << XPath( "//NumberColBox[NumberColBoxHeader[text()='Mean Up Drift']]" ))[1] << Get;
DownDrift = (ps << XPath( "//NumberColBox[NumberColBoxHeader[text()='Mean Down Drift']]" ))[1] << Get;
CombinedDrift = Abs( Matrix(UpDrift) + Matrix(DownDrift) );
ncb = (ps << XPath( "//TableBox" )) << Append( newCol = NumberColBox("Combined Drift", CombinedDrift));
You could add a column to the Process Screening table:
names default to here(1);
dt = Open("$Sample_Data/iris.jmp");
//Open Process Screening with drift summaries
ps = dt << Process Screening(
Y( :Sepal length, :Sepal width, :Petal length, :Petal width ),
Control Chart Type( "Indiv and MR" ),
Drift Summaries( 1 )
);
//calculate the combined drift
UpDrift = (ps << XPath( "//NumberColBox[NumberColBoxHeader[text()='Mean Up Drift']]" ))[1] << Get;
DownDrift = (ps << XPath( "//NumberColBox[NumberColBoxHeader[text()='Mean Down Drift']]" ))[1] << Get;
CombinedDrift = Abs( Matrix(UpDrift) + Matrix(DownDrift) );
//Add column to table with Combined Drift
ncb = (ps << XPath( "//TableBox" )) << Append( NumberColBox("Combined Drift", CombinedDrift) );You should see a new 'Combined Drift' column on the right:
I'm not sure what you mean about the calculated values not matching. Can you give an example of the discrepency?
I agree with your work-around in your second paragraph, recalculating after an update from a data filter might be the easiest path forward.
You're right and I apologize for not catching the incorrect order earlier. I've used this method several times and haven't run into that issue yet (I just went back and re-checked a few scripts of my own). For some reason pulling data out of the table seems to use the sorted order of the table, but when writing data the rows go back in a different order. I will work to resolve that.
I am still working with JMP Support to figure out why the table sorting is applied to values read from the table but not those written to the table. For now here is a crude work around:
names default to here(1);
dt = Open("$Sample_Data/iris.jmp");
//Open Process Screening with drift summaries
ps = dt << Process Screening(
Y( :Sepal length, :Sepal width, :Petal length, :Petal width ),
Control Chart Type( "Indiv and MR" ),
Drift Summaries( 1 )
);
//Add a dummy column and use set values to reset the table order
ncb = (ps << XPath( "//TableBox" )) << Append( newCol = NumberColBox("Delete Me", {}));
newCol << Set Values({});
newCol << Delete Box;
//calculate the combined drift
UpDrift = (ps << XPath( "//NumberColBox[NumberColBoxHeader[text()='Mean Up Drift']]" ))[1] << Get;
DownDrift = (ps << XPath( "//NumberColBox[NumberColBoxHeader[text()='Mean Down Drift']]" ))[1] << Get;
CombinedDrift = Abs( Matrix(UpDrift) + Matrix(DownDrift) );
ncb = (ps << XPath( "//TableBox" )) << Append( newCol = NumberColBox("Combined Drift", CombinedDrift));
Hi,
When going through this post, I was wondering if a solution has been found to address the order of the appended column (Combined Drift)?
Thank you.
I just confirmed with JMP Support that they have not solved the root issue yet, but as far as I know the work around in the accepted solution does solve the problem.
For the issue regarding the sort order of the appended column, i can confirm that this issue will be addressed in the next major release of JMP, which will be available in Fall of 2022. The accepted solution is a good workaround for now.