Hi all,
I have extensively searched this website and I think it's an easy solution, but for some reason I cannot get it to work and I have been stuck with it for 2 days.
In the below script I ask the user which part of specific column he would like to select. For example where the column has the value 8. (the column can have values from 1 up to 8). That I would like to select the rows with this value in this column and create a new dt where I create specific graphs with only this subset of the datatable.
It creates the subset table with the name with the number I have filled in the text box. It shows me what number I have filled in i.e. XNo = "8"; But the Select where ( Column == XNO) does not work. It does not give me an error, it just does not select the specific rows or makes the graph. It makes a new data table with the same name as the datatable I refer to.
If I fill in Select where (column == "8") or Select where( column == it works. I just want that 8 to be variable and that the operater can fill this in himself.
dt = current data table();
col = column(dt,"MILL_X");
col_name_list = dt << get column names( string );
rdata = New Window( "Which part do you want to check?",
<<modal,
<<return result,
X = Text Edit Box( "Which part?" ),
text box("Click OK to save"),
Button box("OK",
XNo = X << Get Text),
Button Box ("Cancel");
);
Show( XNo ); //Shows me the string that was given i.e. if I fill in 8 it shows me --> XNo = "8";
//Selected desired rows based on values on column
dt << Row Selection(
Select where( :MILL_X == XNo ), // <--- This does not work it selects the entire dt instead of the selected value from the column. If I fill in :MILL_X == 8 it works. But only for number 8.
Dialog( Edit( Equal( Source Column( col ) ) ), Keep dialog open( 0 ) )
);
Subset( (Selected Rows), Output Table Name( "X " || Char(ColletNo) || " inspection" ) );
// Create the desired graph using the selected rows
Distribution(
Continuous Distribution(
Column( :"Y (µm)"n ),
Process Capability( LSL( -15 ), Target( 0 ), USL( 15 ) )
)
);
// Optionally, you can customize the graph further here
// For example, adding additional elements or formatting options
dt << clear select;
dt << clear column selection;