I want to update a data table with new columns from a second data table. Interactively it correctly matches the values to the corresponding rows. But in the script it does not. I used expressions, but it seems it has an issue not displayed in the log, as it just adds the helper table to the original data table and does no match.Any ideas why this does not work?
Names Default to here(1);
dt = Open("./OrigTable.jmp");
idgroup = {"A", "B", "C", "D", "E", "F", "G"};
ymeanCleared = {[1.192, 1.349, ., 0.994, 1.101, 0.985, .],[1.054, .,
1.174, ., 1.297, 0.80365, .]};
// Column Dialog to select Parameter "HC-E T/g" and "PN-E T/g"
dlg = Column Dialog(
yCol = Col List( "Y, Data", Data Type( Numeric ), Min Col( 1 ) ),
Line Up( 2, "Significance", a = Edit Number( 0.05 ) ),
"Select data for outlier test"
);
If( dlg["Button"] == -1,
Throw( "User cancelled" )
);
Remove From( dlg );
Eval List( dlg );
for (l=1,l<=N Items (yCol), l++,
paramName = Word (1,Char( Name Expr( ycol[l] ) ),"- ");
ColNameFZ = "Fahrzeug-ID " || paramName;
ColNameM = "Prueffeld Mean " || paramName;
ColNameS = "Prueffeld Stdv " || paramName;
dt_help = New Table( "Help_"||char(num(l)),
Add Rows( N Items(idgroup) ),
New Column( ColNameFZ, Character, Nominal, <<SET values=""></SET>
Some screenshots to help with what I tried:



now interactive update


for (l=1,l<=N Items (yCol), l++,
paramName = Word (1,Char( Name Expr( ycol[l] ) ),"- ");
ColNameFZ = "Fahrzeug-ID " || paramName;
ColNameM = "Prueffeld Mean " || paramName;
ColNameS = "Prueffeld Stdv " || paramName;
dt_help = New Table( "Help_"||char(num(l)),
Add Rows( N Items(idgroup) ),
New Column( ColNameFZ, Character, Nominal, <<SET values=""></SET>
Original script does not run. Not sure whether this one does the work. The main problem seems to be the syntax error in Update.
Thanks, Peng! I'm soooo blind!
Here the issues, in case I'm not alone to see it:
I set the bracket for the width table wrong, and used the wrong column name. In addition the Name Expr(str) in Substitute was the correct way than using the expression within the substitute.