Select rows where column values match items in an arbitrary listHi,
I am trying to write some JSL code to select rows from a table where the value of a column matches some values, which are stored as a list. However, the list may have an arbitrary number of items in it.
I have tried the code at the bottom of the message (where b1 is the list containing my values to be selected, :Lot is the column to compare against and dt2 is the data table to be selected from) but that just selects the rows matching b1[last1]. I know I could produce a subset table for each value of b1[jj] and concatenate them afterwards, but that is messy and causes it's own problems later.
I also tried an Eval(Substitute(Expr( type structure but that didn't work.
Does anyone have any ideas? Or am I going about this completely the wrong way?
Cheers,
Matthew.
For( jj = 1, jj <= last1, jj++,
dt2 << Select Where( :Lot == b1[jj] )
);
Re: Select WhereHi @Jeff_Perkinson , is there a similar trick which can be used together with the new Where?
dt=open("$SAMPLE_DATA\Big Class.jmp");
ages={13, 14, 15};
dt<<SELECT where=""></SELECT>
Re: Select Where
@hogi wrote:
Hi @Jeff_Perkinson , is there a similar trick which can be used together with the new Where?
unfortunately, there is no solution:TS-00225505
Lists, Matrices, and Columns are all assumed to vary together within Where. There is currently no way to escape/prevent this
Re: Select Where-> added to Tiny Traps in Jmp and JSL