Hi ,
I am using Manage Spec Limits to add the SPEC limit into my raw data.
I get all the columns names of raw data, and hope to list it in the Manage Spec Limits window. But it failed.
Pls help to give some ideas.
Thank you.
dt_raw = Open( raw_file );
raw_item = dt_raw << Get Column Names();
dt_spec = Open( spec_file );
obj = dt_raw << Manage Spec Limits(
Y( raw_item ),
Load from Limits Table( dt_spec ),
Show Limits All(0),
Save to Column Properties( 1 )
);
Here is an example of adding an Eval() function to the list to get it to work
Names Default To Here( 1 );
dt_raw = Open( "$SAMPLE_DATA/Cities.jmp" );
colNames = dt_raw << Get Column Names( string, continuous );
dt_spec = New Table( "Cities Limits",
Add Rows( 4 ),
New Column( "Process", Character, Set Values( {"OZONE", "CO", "SO2", "NO"} ) ),
New Column( "LSL", Numeric, Set Values( [0, 0, 0, 0] ) ),
New Column( "Target", Numeric, Set Values( [0.2, 15, 0.05, 0.035] ) ),
New Column( "USL", Numeric, Set Values( [0.4, 30, 0.1, 0.07] ) ),
Set Label Columns( :Process )
);
raw_item ={};
for each row(
If(contains(colNames,:Process), insert into(raw_item,:Process)
));
obj = dt_raw << Manage Limits(
Process Variables( eval(raw_item) ),
Load From Limits Table( dt_spec )
);
obj << Save to Column Properties;
obj << close window;
I also changed the calling structure for the Save to Column Properties. My method seems to work better. But this might just be suppositious behavior.
Here is an example of adding an Eval() function to the list to get it to work
Names Default To Here( 1 );
dt_raw = Open( "$SAMPLE_DATA/Cities.jmp" );
colNames = dt_raw << Get Column Names( string, continuous );
dt_spec = New Table( "Cities Limits",
Add Rows( 4 ),
New Column( "Process", Character, Set Values( {"OZONE", "CO", "SO2", "NO"} ) ),
New Column( "LSL", Numeric, Set Values( [0, 0, 0, 0] ) ),
New Column( "Target", Numeric, Set Values( [0.2, 15, 0.05, 0.035] ) ),
New Column( "USL", Numeric, Set Values( [0.4, 30, 0.1, 0.07] ) ),
Set Label Columns( :Process )
);
raw_item ={};
for each row(
If(contains(colNames,:Process), insert into(raw_item,:Process)
));
obj = dt_raw << Manage Limits(
Process Variables( eval(raw_item) ),
Load From Limits Table( dt_spec )
);
obj << Save to Column Properties;
obj << close window;
I also changed the calling structure for the Save to Column Properties. My method seems to work better. But this might just be suppositious behavior.