Hi all,
I want to get the row number of a value (for example : "Value_A") that might be contained in a column (called "Column_A") without using the following code :
rmat = dt << get rows where( Contains( Column( dt, "Column_A" )[], "Value_A" ) );
Try( row_number_wanted = rmat[1] );
I don't want to use such code because it takes too much time when a lot of values in a big datatable need to be retrived.
Is there a way ?
in JMP18, Where() was introduced as a faster alternative to get rows where().
On the other hand, Get rows where(Contains()) is quite fast for what it has to do.
Can you give an example what "too much time" means? How many rows are there in the data table ?
dt = Open( "$SAMPLE_DATA/Aircraft Incidents.jmp" );
dt= dt << concatenate({dt,dt,dt,dt,dt,dt,dt,dt});
wait(0);
dt= dt << concatenate({dt,dt,dt,dt,dt,dt,dt,dt});<BR />
t0=hptime();
current data table() << get rows where(contains(:location, "SD"));
show(nrows(),(hptime()-t0)/1000000);
t0=hptime();
where(dt,contains(:location, "SD"));
show(nrows(),(hptime()-t0)/1000000);
close(dt, noSave);
Thanks a lot hogi!
It took me more than 1 hour with the Get rows where(Contains(). I had to stop it a some point.
With Where() it took less than 1 minute! Perfect!
Thanks again!